ormolu
ormolu copied to clipboard
Awkward placement of comment on field of data type
Describe the bug
ormolu (version 0.1.4.0) can relocate an inline comment on the field of a data type to an awkward spot
To Reproduce Run ormolu on the following file
data Foo
= Foo Bar {- the bar -} (Baz (Qux Womp)) {- the baz -}
Expected behavior No change to formatting
Actual behavior
data Foo
= Foo Bar {- the bar -} (Baz (Qux Womp {- the baz -}))
In case it wasn't totally clear, the original comment is clearly trying to document the entire Baz field:
(Baz (Qux Womp)) {- the baz -}
whereas after formatting, it gets pushed into Baz's argument:
(Bax (Qux Womp {- the baz -}))