From 671ec1ad8aec260511887788338f186055ac52d1 Mon Sep 17 00:00:00 2001 From: David Waern Date: Sun, 6 Jan 2008 14:40:52 +0000 Subject: Manual merge of a patch to the 0.8 branch Thu Dec 6 15:00:10 CET 2007 Simon Marlow * Source links must point to the original module, not the referring module --- src/Haddock/Interface/Create.hs | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'src/Haddock/Interface/Create.hs') diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index fba25fe2..d2e616cc 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -53,17 +53,19 @@ createInterface ghcMod flags modMap = do | Flag_IgnoreAllExports `elem` flags = OptIgnoreExports : opts0 | otherwise = opts0 - let group = ghcGroup ghcMod - entities = (nubBy sameName . getTopEntities) group - exports = fmap (reverse . map unLoc) (ghcMbExports ghcMod) - entityNames_ = entityNames entities - subNames = allSubNames group - localNames = entityNames_ ++ subNames - subMap = mkSubMap group - expDeclMap = mkDeclMap (ghcExportedNames ghcMod) group - localDeclMap = mkDeclMap entityNames_ group - docMap = mkDocMap group - ignoreExps = Flag_IgnoreAllExports `elem` flags + let group = ghcGroup ghcMod + entities = (nubBy sameName . getTopEntities) group + exports = fmap (reverse . map unLoc) (ghcMbExports ghcMod) + entityNames_ = entityNames entities + subNames = allSubNames group + localNames = entityNames_ ++ subNames + subMap = mkSubMap group + expDeclMap = mkDeclMap (ghcExportedNames ghcMod) group + localDeclMap = mkDeclMap entityNames_ group + docMap = mkDocMap group + ignoreExps = Flag_IgnoreAllExports `elem` flags + exportedNames = ghcExportedNames ghcMod + origEnv = Map.fromList [ (nameOccName n, n) | n <- exportedNames ] visibleNames <- mkVisibleNames mod modMap localNames (ghcNamesInScope ghcMod) @@ -92,8 +94,9 @@ createInterface ghcMod flags modMap = do ifaceRnDocMap = Map.empty, ifaceSubMap = subMap, ifaceExportItems = prunedExportItems, - ifaceRnExportItems = [], - ifaceExports = ghcExportedNames ghcMod, + ifaceRnExportItems = [], + ifaceEnv = origEnv, + ifaceExports = exportedNames, ifaceVisibleExports = visibleNames, ifaceExportedDeclMap = expDeclMap, ifaceInstances = ghcInstances ghcMod -- cgit v1.2.3