avh4 / elm-format

elm-format formats Elm source code according to a standard set of rules based on the official Elm Style Guide
BSD 3-Clause "New" or "Revised" License
1.31k stars 148 forks source link

Comments should not be pulled out of necessary parens in function application arguments #762

Open avh4 opened 2 years ago

avh4 commented 2 years ago

Input:

x f b = f {-A-} ({-B-} 1 + 2) b

Actual output (version 0.8.5):

x f b =
    f {- A -} {- B -} (1 + 2) b

Expected output:

x f b =
    f {- A -} ({- B -} 1 + 2) b

This happens because the merging of the comments is not aware of the syntax context and removes the parens and merges the comments, but luckily the formatter is smart enough to know that the parens need to be added back.