diff options
author | David Waern <david.waern@gmail.com> | 2011-11-26 04:20:12 +0100 |
---|---|---|
committer | David Waern <david.waern@gmail.com> | 2011-11-26 04:20:12 +0100 |
commit | 3ebdc745d7bc79307986332dc71f3495099b4579 (patch) | |
tree | c1e15b26b65e079a52000b37791077eee687d659 /src/Haddock/Interface/Rename.hs | |
parent | c3278a9d3c17ea0929d39116e431a2839bb845ca (diff) |
Give preference to type over data constructors for doc comment links at renaming time.
Previously this was done in the backends.
Also, warn when a doc comment refers to something that is in scope but which we
don't have the .haddock file for.
These changes mean we can make DocIdentifier [a] into DocIdentifier a.
Diffstat (limited to 'src/Haddock/Interface/Rename.hs')
-rw-r--r-- | src/Haddock/Interface/Rename.hs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 88e64cfa..2c10146d 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -58,7 +58,7 @@ renameInterface renamingEnv warnings iface = -- combine the missing names and filter out the built-ins, which would -- otherwise allways be missing. - missingNames = nub $ filter isExternalName + missingNames = nub $ filter isExternalName -- XXX: isExternalName filters out too much (missingNames1 ++ missingNames2 ++ missingNames3) -- filter out certain built in type constructors using their string @@ -171,11 +171,9 @@ renameDoc d = case d of DocParagraph doc -> do doc' <- renameDoc doc return (DocParagraph doc') - DocIdentifier ids -> do - lkp <- getLookupRn - case [ n | (True, n) <- map lkp ids ] of - ids'@(_:_) -> return (DocIdentifier ids') - [] -> return (DocIdentifier (map Undocumented ids)) + DocIdentifier x -> do + x' <- rename x + return (DocIdentifier x') DocModule str -> return (DocModule str) DocEmphasis doc -> do doc' <- renameDoc doc |