aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2007-12-06 14:00:10 +0000
committerSimon Marlow <simonmar@microsoft.com>2007-12-06 14:00:10 +0000
commit64512e4a070a69359bc26d43670cec6abc672caa (patch)
tree70c93181c419e8bf4a8960327822dda4b1fb1bcb
parentb4c2540a12c0e22b6f4e4d3632e811220f2d0d03 (diff)
Source links must point to the original module, not the referring module
-rw-r--r--src/Haddock/Backends/Html.hs14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/Haddock/Backends/Html.hs b/src/Haddock/Backends/Html.hs
index bd709e30..bb0927ca 100644
--- a/src/Haddock/Backends/Html.hs
+++ b/src/Haddock/Backends/Html.hs
@@ -1467,9 +1467,18 @@ topDeclBox ((_,_,maybe_source_url), (_,_,maybe_wiki_url), iface)
case maybe_source_url of
Nothing -> Html.emptyTable
Just url -> tda [theclass "declbut"] <<
- let url' = spliceURL (Just fname) (Just mod)
+ let url' = spliceURL (Just fname) (Just orig_mod)
(Just name) (Just loc) url
in anchor ! [href url'] << toHtml "Source"
+
+ mod = iface_module iface
+
+ -- for source links, we want to point to the original module
+ -- for the name, because only that will have the source.
+ orig_mod = case Map.lookup name (iface_env iface) of
+ Just (Qual m _) -> m
+ _ -> mod
+
wikiLink =
case maybe_wiki_url of
Nothing -> Html.emptyTable
@@ -1478,8 +1487,7 @@ topDeclBox ((_,_,maybe_source_url), (_,_,maybe_wiki_url), iface)
(Just name) (Just loc) url
in anchor ! [href url'] << toHtml "Comments"
- mod = ifaceMod iface
- fname = unpackFS (srcSpanFile loc)
+ mod = iface_module iface
-- a box for displaying an 'argument' (some code which has text to the
-- right of it). Wrapping is not allowed in these boxes, whereas it is