PostProcess/Haddock ignores keywords: module, data, newtype, class, where
The T17544_kw
test case documents a known issue with PostProcess.hs
:
module
-- | Bad comment for the module
T17544_kw where
data Foo -- | Bad comment for MkFoo
where MkFoo :: Foo
newtype Bar -- | Bad comment for MkBar
where MkBar :: () -> Bar
class Cls a
-- | Bad comment for clsmethod
where
clsmethod :: a
All of these comments should be rejected, but currently they are not. I will fix. Plan of attack:
-
Add Maybe BufSpan
to theEpaSpan
constructor ofEpaLocation
. This, in turn, makes it available fromTokenLocation
. -
Store module
,data
,newtype
, andclass
keywords in the AST asLHsToken
. This will make their locations available inPostProcess/Haddock.hs
. -
Use registerLocHdkA
on the tokens to take them into account. This should fix the issue.