Originally reported in https://github.com/tweag/ormolu/issues/901. The issue is that given this input:
module Beckhoff.ADS
( -- $intro
-- * Connections
ConnectInfo(..)
) where
The comment ends up in two different places:
(L
(Anchor
{ <input>:(2,5)-(3,20) }
(UnchangedAnchor))
(EpaComment
(EpaDocCommentNamed
"intro\n * Connections")
{ <input>:2:3 }))
IEDocNamed
):(L
(SrcSpanAnn (EpAnnNotUsed) { <input>:(2,5)-(3,20) })
(IEDocNamed
(NoExtField)
"intro"))
However, the Haddock version is truncated and does not contain the -- * Connections
part. This, one could argue, is misleading because the -- *
construct (supposed to start a new section) is not recognized in this case, presumably because there is no empty line between the -- $
part and the -- *
part?
Run the parser on the snippet provided above.
I think there are two ways to resole it:
-- *
even when it follows -- $
without a newline between them. This seems to me preferable because it is what users would normally want.Optional: