From 3be46a2ec472c4f220f1eac1bd029690086b8c18 Mon Sep 17 00:00:00 2001 From: Ɓukasz Hanuszczak Date: Sat, 25 Jul 2015 20:49:17 +0200 Subject: Override source line flags when source hyperlinker is enabled. --- haddock-api/src/Haddock.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'haddock-api') diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index 350a73ea..8f327b09 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -280,8 +280,13 @@ render dflags flags qual ifaces installedIfaces extSrcMap = do | otherwise = pkgSrcMap -- TODO: Get these from the interface files as with srcMap - srcLMap' = maybe Map.empty (\path -> Map.singleton pkgKey path) srcLEntity - sourceUrls' = (srcBase, srcModule', pkgSrcMap', srcLMap') + pkgSrcLMap' + | Flag_HyperlinkedSource `elem` flags = + Map.singleton pkgKey hypSrcModuleLineUrlFormat + | Just path <- srcLEntity = Map.singleton pkgKey path + | otherwise = Map.empty + + sourceUrls' = (srcBase, srcModule', pkgSrcMap', pkgSrcLMap') libDir <- getHaddockLibDir flags prologue <- getPrologue dflags flags -- cgit v1.2.3