Closed emlautarom1 closed 4 months ago
Thanks for the report! Region formatting only works when the selection is still parseable Haskell code on its own, as Ormolu relies on the GHC parser. Hence, we currently don't support your use case.
We could mention this in the corresponding README paragraph.
Describe the bug Ormolu is unable to format a selection when it contains a
->
symbol (ex. case expressions)To Reproduce
() -> ()
lineFormat Selection
commandExpected behavior The code should be formatted to
() -> ()
(removes the additional spaces between->
and()
)Environment
Additional context Originally, I thought that this problem was with HLS (see: https://github.com/haskell/haskell-language-server/issues/4074) but I was able to narrow it down to Ormolu. The original use case is to format only modified lines, which sometimes can be patterns in case expressions.