eclipse-archived / ceylon.formatter

A formatter for the Ceylon programming language, written in Ceylon.
Apache License 2.0
14 stars 11 forks source link

Formatting doc annotations #138

Closed welopino closed 7 years ago

welopino commented 7 years ago

The whitespace before opening "(" causes problems. I use the standard configuration of the formatter of ceylon 1.3.2.: The result of formatting looks like that:

doc ("

     fdsfdsfs
     sfds")
by ("
     dsf dsf d
     sf
     sdfa"
)

The compiler knows it better than the formatter:

source/selftypecheck/run2.ceylon:6: error: multiline string content should align with start of string: string begins at character position 6
doc ("
     ^
1 error
...
lucaswerkmeister commented 7 years ago

I can’t reproduce this – can you please post your original code before formatting?

lucaswerkmeister commented 7 years ago

To clarify: if you take your result of formatting, and format it again, it will still be broken – but that’s not a bug: it’s only a bug if the formatter takes valid code and breaks it. To fix that, or even know if that’s the case, I need the original, unformatted code.

Also, are you sure you used ceylon.formatter and not the IntelliJ IDE’s formatter?

lucaswerkmeister commented 7 years ago

@welopino if you can’t provide steps to reproduce this, I’ll have to close this issue. ceylon.formatter should handle this situation correctly (I remember implementing it – not fun :D ), and I suspect you may have been using IntelliJ’s formatter (which is separate and, as far as I know, less sophisticated).