From 42d49d550642aa58696af91bb250487ac42e9095 Mon Sep 17 00:00:00 2001 From: Ɓukasz Hanuszczak Date: Tue, 21 Jul 2015 14:44:22 +0200 Subject: Attach source locations to the specialized class methods. --- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'haddock-api/src/Haddock/Backends/Xhtml') diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index 4862945a..67405915 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -223,14 +223,13 @@ ppTyName :: Name -> Html ppTyName = ppName Prefix -ppSimpleSig :: LinksInfo -> Splice -> Unicode -> Qualification +ppSimpleSig :: LinksInfo -> Splice -> Unicode -> Qualification -> SrcSpan -> [DocName] -> HsType DocName -> Html -ppSimpleSig links splice unicode qual names typ = +ppSimpleSig links splice unicode qual loc names typ = topDeclElem' names $ ppTypeSig True occNames ppTyp unicode where - -- TODO: Use *helpful* source span. - topDeclElem' = topDeclElem links (UnhelpfulSpan undefined) splice + topDeclElem' = topDeclElem links loc splice ppTyp = ppType unicode qual typ occNames = map getOccName names @@ -551,10 +550,10 @@ ppInstanceSigs :: LinksInfo -> Splice -> Unicode -> Qualification -> InstSpec DocName -> InstHead DocName -> [Html] ppInstanceSigs links splice unicode qual (InstSpec {..}) (InstHead {..}) = do - TypeSig lnames (L sspan typ) _ <- ispecSigs + TypeSig lnames (L loc typ) _ <- ispecSigs let names = map unLoc lnames let typ' = rename' . sugar $ specializeTyVarBndrs ispecTyVars ihdTypes typ - return $ ppSimpleSig links splice unicode qual names typ' + return $ ppSimpleSig links splice unicode qual loc names typ' where fv = foldr Set.union Set.empty . map freeVariables $ ihdTypes rename' = rename fv -- cgit v1.2.3