[Git][ghc/ghc][wip/haddock-mem-fixes] 2 commits: Fix associated data family doc structure items

Finley McIlwaine (@FinleyMcIlwaine) gitlab at gitlab.haskell.org
Thu Jun 8 22:33:49 UTC 2023



Finley McIlwaine pushed to branch wip/haddock-mem-fixes at Glasgow Haskell Compiler / GHC


Commits:
2f9e52da by Finley McIlwaine at 2023-06-08T16:33:23-06:00
Fix associated data family doc structure items

Associated data families were being given their own export DocStructureItems,
which resulted in them being documented separately from their classes in
haddocks. This commit fixes it.

- - - - -
048b3f35 by Finley McIlwaine at 2023-06-08T16:33:38-06:00
Bump haddock submodule

- - - - -


3 changed files:

- compiler/GHC/Hs/Doc.hs
- compiler/GHC/HsToCore/Docs.hs
- utils/haddock


Changes:

=====================================
compiler/GHC/Hs/Doc.hs
=====================================
@@ -123,7 +123,7 @@ type LHsDoc pass = Located (HsDoc pass)
 data DocStructureItem
   = DsiSectionHeading !Int !(HsDoc GhcRn)
   | DsiDocChunk !(HsDoc GhcRn)
-  | DsiNamedChunkRef !(String)
+  | DsiNamedChunkRef !String
   | DsiExports !Avails
   | DsiModExport
       !(NonEmpty ModuleName) -- ^ We might re-export avails from multiple


=====================================
compiler/GHC/HsToCore/Docs.hs
=====================================
@@ -192,7 +192,13 @@ mkDocStructureFromDecls env all_exports decls =
         Just loc -> L loc (DsiExports [avail])
         -- FIXME: This is just a workaround that we use when handling e.g.
         -- associated data families like in the html-test Instances.hs.
-        Nothing -> noLoc (DsiExports [avail])
+        Nothing -> noLoc (DsiExports [])
+
+        -- This causes the associated data family to be incorrectly documented
+        -- separately from its class:
+        -- Nothing -> noLoc (DsiExports [avail])
+
+        -- This panics on the associated data family:
         -- Nothing -> panicDoc "mkDocStructureFromDecls: No loc found for"
         --                     (ppr avail)
 


=====================================
utils/haddock
=====================================
@@ -1 +1 @@
-Subproject commit 30cf825972c53d97d6add9aa0e61bcb32ccc3ad1
+Subproject commit 61b0845b3e3268b469db8bb20fd3d19118453727



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f8fe18581bfb1edc86444ced1ac44fcd70c50a86...048b3f35b22060c584d2b2ba5cc1303af3ab2f0f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f8fe18581bfb1edc86444ced1ac44fcd70c50a86...048b3f35b22060c584d2b2ba5cc1303af3ab2f0f
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230608/da8652dd/attachment-0001.html>


More information about the ghc-commits mailing list