aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src
diff options
context:
space:
mode:
authorŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-07-06 18:07:20 +0200
committerŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-07-06 18:07:20 +0200
commit0e1cad7c38ed1a771794d9332233f784a52d2c1a (patch)
tree4888c7727c8fb3f93998aaefa82af47b2ddbcb63 /haddock-api/src
parentb6e9968643bc0ab6c61289ecee7205e4d7bc421a (diff)
Fix bug with module name being hyperlinked to `Prelude`.
Diffstat (limited to 'haddock-api/src')
-rw-r--r--haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs
index 28fdc3f5..71b73663 100644
--- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs
+++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs
@@ -146,7 +146,7 @@ decls (group, _, _, _) = concatMap ($ group)
-- import lists.
imports :: GHC.RenamedSource -> DetailsMap
imports src@(_, imps, _, _) =
- everything (<|>) ie src ++ map (imp . GHC.unLoc) imps
+ everything (<|>) ie src ++ mapMaybe (imp . GHC.unLoc) imps
where
ie term = case cast term of
(Just (GHC.IEVar v)) -> pure $ var v
@@ -156,9 +156,10 @@ imports src@(_, imps, _, _) =
_ -> empty
typ (GHC.L sspan name) = (sspan, RtkType name)
var (GHC.L sspan name) = (sspan, RtkVar name)
- imp idecl =
+ imp idecl | not . GHC.ideclImplicit $ idecl =
let (GHC.L sspan name) = GHC.ideclName idecl
- in (sspan, RtkModule name)
+ in Just (sspan, RtkModule name)
+ imp _ = Nothing
-- | Check whether token stream span matches GHC source span.
--