crystal
crystal copied to clipboard
Unwanted line break added by the formatter
I encounter a strange behavior from the formatter:
When a comment is added to the end of an instruction line, a line feed is systematically added before the def instruction that immediately follows.
As far as I've been able to check, this only applies to the def statement.
Here's an example
- before formatting
class Test
getter var # it is a getter
# :nodoc:
# method bam is ...
def bam(@var : String)
end
end
- after formatting
class Test
getter var # it is a getter
# :nodoc:
# method bam is ...
def bam(@var : String)
end
end
Of course, this has one annoying consequence: it becomes impossible to document the method or apply a :nodoc: