eclipse-langium / langium

Next-gen language engineering / DSL framework
https://langium.org/
MIT License
663 stars 61 forks source link

Fix cyclic formatter behavior #1550

Closed msujew closed 2 weeks ago

msujew commented 2 weeks ago

Closes https://github.com/eclipse-langium/langium/issues/1362

The issue was that the isNecessary logic is too eager in case there are conflicting formattings. To explain in short: Sometimes, this filtered the expected formatting and only left over the "unexpected" formatting. When reformatting, the expected and unexpected formatting "switched places" and this led to cyclic behavior.

Note that this issue wasn't reproducible on Windows, due to erroneous comparisons between \n and \r\n.