Ticket #6143: 6143.patch

File 6143.patch, 1.1 KB (added by pcapriotti, 3 years ago)
  • src/Haddock/Interface/Create.hs

    From 105f31e1b5b1428ae27590893740017327d322ff Mon Sep 17 00:00:00 2001
    From: Paolo Capriotti <[email protected]>
    Date: Fri, 22 Jun 2012 18:26:47 +0100
    Subject: [PATCH] Use right docMap to get decl documentation.
    
    ---
     src/Haddock/Interface/Create.hs |    8 +++++++-
     1 files changed, 7 insertions(+), 1 deletions(-)
    
    diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs
    index 6c35a12..c3d5d29 100644
    a b mkExportItems 
    433433 
    434434    declWith :: Name -> ErrMsgGhc [ ExportItem Name ] 
    435435    declWith t = 
    436       let (doc, subs) = exportDecl t docMap argMap subMap in 
     436      let mdl = nameModule t 
     437          (doc, subs) 
     438            | mdl == thisMod = 
     439                exportDecl t docMap argMap subMap 
     440            | Just iface <- M.lookup mdl modMap = 
     441                exportDecl t (ifaceDocMap iface) (ifaceArgMap iface) (ifaceSubMap iface) 
     442            | otherwise = (noDocForDecl, []) in 
    437443      case findDecl t of 
    438444        [L _ (ValD _)] -> do 
    439445          -- Top-level binding without type signature