From 6319cccbd95ba15db6f34101577034233cdc8f88 Mon Sep 17 00:00:00 2001 From: David Waern Date: Thu, 16 Oct 2008 20:58:42 +0000 Subject: Fix #61 We were not getting docs for re-exported class methods. This was because we were looking up the docs in a map made from the declarations in the current module being rendered. Obviously, re-exported class methods come from another module. Class methods and ATs were the only thing we were looking up using the doc map, everything else we found in the ExporItems. So now I've put subordinate docs in the ExportItem's directly, to make things a bit more consistent. To do this, I added subordinates to the the declarations in the declaration map. This was easy since we were computing subordinates anyway, to store stand-alone in the map. I added a new type synonym 'DeclInfo', which is what we call what is now stored in the map. This little refactoring removes duplicate code to retrieve subordinates and documentation from the HsGroup. --- src/Haddock/Interface/Rename.hs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/Haddock/Interface/Rename.hs') diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 3efc2526..3675f0b4 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -369,9 +369,10 @@ renameTyClD d = case d of renameSig sig = case sig of - TypeSig (L loc name) ltype -> do + TypeSig lname ltype -> do + lname' <- renameL lname ltype' <- renameLType ltype - return (TypeSig (L loc (keep name)) ltype') + return (TypeSig lname' ltype') -- we have filtered out all other kinds of signatures in Interface.Create @@ -395,11 +396,12 @@ renameExportItem item = case item of ExportGroup lev id doc -> do doc' <- renameDoc doc return (ExportGroup lev id doc') - ExportDecl decl doc instances -> do + ExportDecl decl doc subs instances -> do decl' <- renameLDecl decl doc' <- mapM renameDoc doc + subs' <- mapM renameSub subs instances' <- mapM renameInstHead instances - return (ExportDecl decl' doc' instances') + return (ExportDecl decl' doc' subs' instances') ExportNoDecl x y subs -> do y' <- lookupRn id y subs' <- mapM (lookupRn id) subs @@ -407,3 +409,9 @@ renameExportItem item = case item of ExportDoc doc -> do doc' <- renameDoc doc return (ExportDoc doc') + + +renameSub (n,doc) = do + n' <- rename n + doc' <- renameDoc doc + return (n', doc') -- cgit v1.2.3