elm-format icon indicating copy to clipboard operation
elm-format copied to clipboard

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

Open avh4 opened this issue 2 years ago • 0 comments

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.

avh4 avatar Jan 14 '22 05:01 avh4