Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idempotence bug with indented multi-line haddocks #273

Closed
1 task done
brandonchinn178 opened this issue Dec 3, 2022 · 0 comments · Fixed by #274
Closed
1 task done

Idempotence bug with indented multi-line haddocks #273

brandonchinn178 opened this issue Dec 3, 2022 · 0 comments · Fixed by #274
Labels
bug Something isn't working

Comments

@brandonchinn178
Copy link
Collaborator

brandonchinn178 commented Dec 3, 2022

Is your bug specific to Fourmolu?

  • Yes, I've verified that Ormolu does not have this bug

Describe the bug
#255 made it so that a leading space in single line comments don't count as part of a comment, but it causes "AST of input and AST of formatted code differ" on indented haddocks:

{- | Test

   3 spaces before this line
-}
foo :: Int

I assume this is because {- -} haddocks are all included as one long "Test\n\n 3 spaces before this line" string and we don't ignore leading whitespace after newline characters

For now, a workaround is to put the first line on the next line. No idea why this works.

{- |
Test

   3 spaces before this line
-}
foo :: Int
@brandonchinn178 brandonchinn178 added the bug Something isn't working label Dec 3, 2022
@brandonchinn178 brandonchinn178 changed the title AST error with indented multi-line haddocks Idempotence bug with indented multi-line haddocks Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant