Skip to content

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:

  1. Add Maybe BufSpan to the EpaSpan constructor of EpaLocation. This, in turn, makes it available from TokenLocation.
  2. Store module, data, newtype, and class keywords in the AST as LHsToken. This will make their locations available in PostProcess/Haddock.hs.
  3. Use registerLocHdkA on the tokens to take them into account. This should fix the issue.
Edited by Vladislav Zavialov
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information