aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
diff options
context:
space:
mode:
authorAlec Theriault <alec.theriault@gmail.com>2018-07-20 03:02:16 -0700
committerSimon Jakobi <simon.jakobi@gmail.com>2018-07-20 13:39:29 +0200
commit8ac6ac1097f2ec2bc9a7f9bdd765abf71164bfcb (patch)
treef8911653de7ac3b57bdb02ee8c8640b31b3c95aa /haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
parent0b50627a7ae8bfbcfe771eac71cc1975903d118e (diff)
Fix broken instance source links (#869)
The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05)
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Xhtml/Decl.hs')
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/Decl.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
index 2f3c1ba1..cc271fef 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
@@ -620,9 +620,9 @@ ppInstances links origin instances splice unicode pkg qual
-- force Splice = True to use line URLs
where
instName = getOccString origin
- instDecl :: Int -> DocInstance DocNameI -> (SubDecl,Located DocName)
+ instDecl :: Int -> DocInstance DocNameI -> (SubDecl, Maybe Module, Located DocName)
instDecl no (inst, mdoc, loc, mdl) =
- ((ppInstHead links splice unicode qual mdoc origin False no inst mdl), loc)
+ ((ppInstHead links splice unicode qual mdoc origin False no inst mdl), mdl, loc)
ppOrphanInstances :: LinksInfo
@@ -635,9 +635,9 @@ ppOrphanInstances links instances splice unicode pkg qual
instOrigin :: InstHead name -> InstOrigin (IdP name)
instOrigin inst = OriginClass (ihdClsName inst)
- instDecl :: Int -> DocInstance DocNameI -> (SubDecl,Located DocName)
+ instDecl :: Int -> DocInstance DocNameI -> (SubDecl, Maybe Module, Located DocName)
instDecl no (inst, mdoc, loc, mdl) =
- ((ppInstHead links splice unicode qual mdoc (instOrigin inst) True no inst mdl), loc)
+ ((ppInstHead links splice unicode qual mdoc (instOrigin inst) True no inst Nothing), mdl, loc)
ppInstHead :: LinksInfo -> Splice -> Unicode -> Qualification