aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Haddock/GHC/Typecheck.hs1
-rw-r--r--src/Haddock/Interface/Create.hs9
-rw-r--r--src/Haddock/Types.hs1
3 files changed, 3 insertions, 8 deletions
diff --git a/src/Haddock/GHC/Typecheck.hs b/src/Haddock/GHC/Typecheck.hs
index 2a9811c9..f0626231 100644
--- a/src/Haddock/GHC/Typecheck.hs
+++ b/src/Haddock/GHC/Typecheck.hs
@@ -75,6 +75,7 @@ mkGhcModule (mod, file, checkedMod) dynflags = GhcModule {
ghcGroup = group,
ghcMbExports = mbExports,
ghcExportedNames = modInfoExports modInfo,
+ ghcDefinedNames = map getName $ modInfoTyThings modInfo,
ghcNamesInScope = fromJust $ modInfoTopLevelScope modInfo,
ghcInstances = modInfoInstances modInfo
}
diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs
index 60d657c0..b5ebe255 100644
--- a/src/Haddock/Interface/Create.hs
+++ b/src/Haddock/Interface/Create.hs
@@ -57,10 +57,8 @@ createInterface ghcMod flags modMap = do
entities = (nubBy sameName . getTopEntities) group
exports = fmap (reverse . map unLoc) (ghcMbExports ghcMod)
entityNames_ = entityNames entities
- subNames = allSubNames group
- localNames = entityNames_ ++ subNames
+ localNames = ghcDefinedNames ghcMod
subMap = mkSubMap group
--- declMap = mkDeclMap entityNames_ group
declMap = mkDeclMap localNames group
docMap = mkDocMap group
ignoreExps = Flag_IgnoreAllExports `elem` flags
@@ -255,11 +253,6 @@ mkDocMap group = Map.fromList (topDeclDocs ++ classMethDocs ++ recordFieldDocs)
ConDeclField lname _ (Just (L _ doc)) <- fields ]
-allSubNames :: HsGroup Name -> [Name]
-allSubNames group =
- concat [ tail (map unLoc (tyClDeclNames tycld)) | L _ tycld <- hs_tyclds group ]
-
-
mkSubMap :: HsGroup Name -> Map Name [Name]
mkSubMap group = Map.fromList [ (name, subs) | L _ tycld <- hs_tyclds group,
let name:subs = map unLoc (tyClDeclNames tycld) ]
diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs
index f120bc85..38d56b49 100644
--- a/src/Haddock/Types.hs
+++ b/src/Haddock/Types.hs
@@ -100,6 +100,7 @@ data GhcModule = GhcModule {
ghcGroup :: HsGroup Name,
ghcMbExports :: Maybe [LIE Name],
ghcExportedNames :: [Name],
+ ghcDefinedNames :: [Name],
ghcNamesInScope :: [Name],
ghcInstances :: [Instance]
}