Closed robx closed 3 years ago
Describe the bug
(EDIT: I first thought this was due to the where clause, instead it's because of the bananas in a do. Updated accordingly.)
where
ormolu formats a valid expression of the form
foo = do (| -- body |)
to the following which doesn't parse (outdenting the closing bracket)
To Reproduce
$ cat test.hs {-# LANGUAGE Arrows #-} foo = proc (x, y) -> do (| g (a -< z) |) $ ormolu test.hs test.hs:7:3 Parsing of formatted code failed: parse error (possibly incorrect indentation or mismatched brackets) $ ormolu -u test.hs {-# LANGUAGE Arrows #-} foo = proc (x, y) -> do (| g (a -< z) |)
Expected behavior The code should be formatted to parseable code (with the same AST). That would probably mean keeping the half-indentation level?
Environment current master on macos
This isn't related to the problems solved by the half-indent in PR #731, is it?
I think it's not related.
Describe the bug
(EDIT: I first thought this was due to the
where
clause, instead it's because of the bananas in a do. Updated accordingly.)ormolu formats a valid expression of the form
to the following which doesn't parse (outdenting the closing bracket)
To Reproduce
Expected behavior The code should be formatted to parseable code (with the same AST). That would probably mean keeping the half-indentation level?
Environment current master on macos