Closed sergey-kintsel closed 6 years ago
@danstiner could you take a look please?
Nice catch and thanks for the PR! What you pointed to is test code, but the main entry-point uses the same default extensions: https://github.com/commercialhaskell/hindent/blob/0721221ede01d6a3468e562fd7ea0df114de34e2/src/HIndent.hs#L312
I'll try to cut a new point release soon with this fix.
I am trying to format this code:
and I get this:
The thing is that if I change
using
tousingA
it works just fine. I debugged it a bit and got to this line: https://github.com/danstiner/hfmt/blob/master/src/Language/Haskell/Format.hs#L36 I have experimented with the list of formatters and it appears that indeed hindent fails. The funny thing is that hindent itself doesn't break if I run it alone.The easiest solution is to follow the way hindent itself uses
reformat
function https://github.com/commercialhaskell/hindent/blob/889e1655c6eb170e0d30c3c1173f7fba87041736/src/main/Test.hs#L32