-
Notifications
You must be signed in to change notification settings - Fork 83
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
Differing AST on empty {- ^ -} Haddock markup #1065
Comments
Thanks for the report! The problem is that in the input, the AST contains a Haddock comment ( Hence, with #1068, your example data T = T {- ^ -} is formatted to data T = T Hope this makes sense! |
Thanks for your response @amesgen.
It makes sense but I think it's the wrong thing to do. See #1068 (comment) |
Personally I would prefer the approach that AST diffing considers comments consisting of only of any amount of whitespace to be equivalent. |
Or, if you want to keep AST diffing as it is, then I think that translating empty |
(Just FTR: There is additional discussion in #1068) |
Describe the bug
If I have an empty
{- ^ -}
Haddock annotation thenormolu
fails with anAST of input and AST of formatted code differ
error.To Reproduce
Expected behavior
ormolu
to produce the same reformatted code as above but to not complain that the ASTs differ (I don't think they do!).{- ^ ... -}
is not mentioned in the Haddock documentation as valid Haddock syntax, but it does accept it. Note that if there is text in the markup then everything is fine:Environment
Additional context
ormolu
is great, thanks!Perhaps related: #822
The text was updated successfully, but these errors were encountered: