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 BufSpanto theEpaSpanconstructor ofEpaLocation. This, in turn, makes it available fromTokenLocation. -
Store module,data,newtype, andclasskeywords in the AST asLHsToken. This will make their locations available inPostProcess/Haddock.hs. -
Use registerLocHdkAon the tokens to take them into account. This should fix the issue.
Edited by Vladislav Zavialov