Open KieranP opened 6 days ago
Just FYI: rbs-inline expects one or more spaces for continued lines:
Therefore this is valid.
# @rbs attrs: {
# x: Integer?,
# y: Integer?,
# w: Integer?,
# l: Integer?,
# h: Integer?,
# }
@tk0miya Hmm, interesting. When all my ruby code is indented by two spaces, why do the @rbs
comments require at least 3 space and to be not synced up (the closing brace is in a different column than the @
of @rbs
? :-/ It would be much cleaner IMO if the first example worked.
Edit: Infact it works with the attrs being indented by two spaces, it's only the last brace that needs to be indented one more than it should be. So for now, I'll use:
# @rbs attrs: {
# x: Integer?,
# y: Integer?,
# w: Integer?,
# l: Integer?,
# h: Integer?,
# }
It’s because the expectation was essentially:
# @rbs attrs:
# {
# x: Integer?,
# y: Integer?,
# w: Integer?,
# l: Integer?,
# h: Integer?,
# }
A better example from the @rbs!
docs:
# @rbs!
# attr_accessor id (): Integer
# attr_accessor name (): String
Support for defining method attributes over multiple lines