aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock.hs
diff options
context:
space:
mode:
authorŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-06-26 21:13:12 +0200
committerŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-06-30 22:37:49 +0200
commitaffd889d1b192d2cb9787c92202317b9e9401922 (patch)
treea0087f36a466dd1d2cbfc6253a49beb27e7d30fc /haddock-api/src/Haddock.hs
parenta6bd86a8550d5d7e8bdb12e1d09036b9f88eed73 (diff)
Make source hyperlinker generate output in apropriate directory.
Diffstat (limited to 'haddock-api/src/Haddock.hs')
-rw-r--r--haddock-api/src/Haddock.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs
index 698122e3..01e4cd45 100644
--- a/haddock-api/src/Haddock.hs
+++ b/haddock-api/src/Haddock.hs
@@ -258,10 +258,16 @@ render dflags flags qual ifaces installedIfaces srcMap = do
pkgNameVer = modulePackageInfo dflags flags pkgMod
(srcBase, srcModule, srcEntity, srcLEntity) = sourceUrls flags
+
+ srcModule'
+ | isJust srcModule = srcModule
+ | Flag_HyperlinkedSource `elem` flags = Just defaultModuleSourceUrl
+ | otherwise = Nothing
+
srcMap' = maybe srcMap (\path -> Map.insert pkgKey path srcMap) srcEntity
-- TODO: Get these from the interface files as with srcMap
srcLMap' = maybe Map.empty (\path -> Map.singleton pkgKey path) srcLEntity
- sourceUrls' = (srcBase, srcModule, srcMap', srcLMap')
+ sourceUrls' = (srcBase, srcModule', srcMap', srcLMap')
libDir <- getHaddockLibDir flags
prologue <- getPrologue dflags flags
@@ -311,7 +317,7 @@ render dflags flags qual ifaces installedIfaces srcMap = do
libDir
when (Flag_HyperlinkedSource `elem` flags) $ do
- ppHyperlinkedSource odir libDir opt_source_css visibleIfaces
+ ppHyperlinkedSource odir libDir opt_source_css sourceUrls' visibleIfaces
-- | From GHC 7.10, this function has a potential to crash with a
-- nasty message such as @expectJust getPackageDetails@ because