tweag / ormolu

A formatter for Haskell source code
https://ormolu-live.tweag.io
Other
958 stars 83 forks source link

Only output is "AST of input and AST of formatted code differ." #686

Closed typetetris closed 3 years ago

typetetris commented 3 years ago

We have a file, which results in the output

  AST of input and AST of formatted code differ.
  Please, consider reporting the bug.

So we have sadly no way to reduce it to a minimal example.

It would be very convenient if ormolu would just output the file created from the new ast, so we could have a look at it and identify, where the mismatch was.

mrkkrp commented 3 years ago

What does ormolu --version say?

typetetris commented 3 years ago
ormolu 0.1.4.1 UNKNOWN UNKNOWN
using ghc-lib-parser 8.10.4.20210206
mrkkrp commented 3 years ago

Normally, the positions in the original input (line/column number) are output as well. Apparently, in your case no such information is available. I can't help without a way to reproduce the issue.

typetetris commented 3 years ago

Is there no way to get a representation of the new AST? We really don't want to disclose our source code.

mrkkrp commented 3 years ago

Try to do binary search on the source code to figure out what triggers the error.

mrkkrp commented 3 years ago

Closing due to lack of a reproducing example. If you manage to create one please re-open.