diff options
author | Ćukasz Hanuszczak <lukasz.hanuszczak@gmail.com> | 2015-07-25 20:49:17 +0200 |
---|---|---|
committer | Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk> | 2015-08-02 23:32:15 +0100 |
commit | 3be46a2ec472c4f220f1eac1bd029690086b8c18 (patch) | |
tree | 1fd06a59db66285311e7ffc671f58592bbc0cb5d /haddock-api/src/Haddock.hs | |
parent | 7eafa83ffaf535ae8c1a038f004a254192d08afc (diff) |
Override source line flags when source hyperlinker is enabled.
Diffstat (limited to 'haddock-api/src/Haddock.hs')
-rw-r--r-- | haddock-api/src/Haddock.hs | 9 |
1 files changed, 7 insertions, 2 deletions
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 |