-
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
Haddock comments on un-named fields are not handled correctly #428
Comments
Note: this is a minimized real-world example taken from GHC's sources. |
Is this a bug in Ormolu or in Haddock? If latter, there is not much we can do except for reporting it. |
Well, it's a bug in GHC, essentially: haskell/haddock#1065. The only way to work around it is to use data Foo
= Bar
-- ^ Constructor
Int
-- ^ Field 1 I.e. for any constructors that have unnamed fields with haddocks, we will have to use this alternative syntax. |
As for the second issue (lost comments), yeah, it's possible that there's nothing we can do about it. We might be able to parse with and without |
Related (almost the same issue): #445. |
Parsing of formatted code failed
Input:
Error:
Output with
--unsafe
:The behavior of the Haddock parser is horrifying.
Lost comments
Input:
Output:
The text was updated successfully, but these errors were encountered: