diff options
author | Henning Thielemann <git@henning-thielemann.de> | 2012-04-01 22:03:25 +0200 |
---|---|---|
committer | Henning Thielemann <git@henning-thielemann.de> | 2012-04-01 22:03:25 +0200 |
commit | 979ada5bc63cba38bf570f943a3666298879bdc9 (patch) | |
tree | 67f86313b43e70306e26f9a80b5c32de2c3ad5b4 /src/Haddock/Interface | |
parent | e9898d45575458d49eb2119923c8c1adbc581065 (diff) |
'abbreviate' qualification style - basic support
Currently we ignore the package a module is imported from.
This means that a module import would shadow another one
with the same module name from a different package.
Diffstat (limited to 'src/Haddock/Interface')
-rw-r--r-- | src/Haddock/Interface/Create.hs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 94575209..9f183432 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -30,6 +30,7 @@ import Control.Applicative import Control.Monad import qualified Data.Traversable as T +import qualified SrcLoc import GHC hiding (flags) import HscTypes import Name @@ -106,6 +107,18 @@ createInterface tm flags modMap instIfaceMap = do | OptPrune `elem` opts = prunedExportItems0 | otherwise = exportItems + let abbrevs = + case tm_renamed_source tm of + Nothing -> M.empty + Just (_,impDecls,_,_) -> + M.fromList $ + mapMaybe (\(SrcLoc.L _ impDecl) -> do + abbrev <- ideclAs impDecl + return + (case ideclName impDecl of SrcLoc.L _ name -> name, + abbrev)) + impDecls + return Interface { ifaceMod = mdl, ifaceOrigFilename = msHsFilePath ms, @@ -123,6 +136,7 @@ createInterface tm flags modMap instIfaceMap = do ifaceVisibleExports = visibleNames, ifaceDeclMap = declMap, ifaceSubMap = subMap, + ifaceModuleAbbrevs = abbrevs, ifaceInstances = instances, ifaceHaddockCoverage = coverage } |