-
Notifications
You must be signed in to change notification settings - Fork 236
Conversation
Corresponding change in ghc: sjakobi/ghc@19adbf6.
(cherry picked from commit 396961f)
We're stilling missing some info. See FIXMEs.
@harpocrates I've updated the Phab diff according to your instructions. Thanks a lot for the rebase! I actually wouldn't mind if you'd comandeer the diff BTW. |
@harpocrates Could you give cad2ed9 a quick review? The main thing I'm worried about is that in haddock/haddock-api/src/Haddock/Interface/LexParseRn.hs Lines 193 to 196 in cad2ed9
|
Summary: This extends my work from D4758 and enables haddock to generate docs from information enclosed in the `.hi` interface files. * `HaddockLex` contains an Alex-based lexer for docstrings that detects identifiers delimited with `'` or backticks. * `HsDoc.Docs` comprises the `DeclDocMap` and `ArcDocMap` structures added in D4758 and other data needed by haddock. * haddock now uses `GhcMake.load'` to load `.hi`-files, hooking into GHC's recompilation avoidance. In order to avoid recompilation when a `.hi`-file already contains documentation we use a new option `Opt_SkipIfaceVersionCheck`. * [ ] Work out a specification for a deterministic module structure (`docs_structure`) and update the existing code to implement it. The `HaddockIssue849` test case is currently flaky because the ordering of constructors in the `Avail` for `Maybe` fluctuates. * [ ] Possibly fuse `mi_exports` and `docs_structure`. Currently both serialize the same `Avails`. * [ ] Get the recompilation avoidance right: While some of the checks performed in `checkVersions` are irrelevant for haddock, we may want to keep some of them. We probably also want `-haddock` to cause recompilation if an existing `.hi`-file doesn't contain the `Docs`. * [ ] Fix the tests. `./validate` currently reports failures for `TEST="HaddockIssue849 ImpSafeOnly01 ImpSafeOnly02 ImpSafeOnly03 ImpSafeOnly04 ImpSafeOnly05 ImpSafeOnly06 ImpSafeOnly07 ImpSafeOnly08 ImpSafeOnly09 ImpSafeOnly10 Splices T13168 T14304 T4029 T9881 break006 break011 break013 break024 cabal01 dynamicToo002 dynamicToo005 haddock.base haddock.compiler hist001 hist002 plugins09 plugins11 print026 safePkg01"` Several more (minor) issues are marked `TODO` in the source code. --- The corresponding changes in haddock are [here](haskell/haddock#906). * Add an option to configure the identifier delimiters the lexer looks for. * Add an option to make the lexer exclude birdtracks. * Make the `:doc` command also pretty-print arg docs. Reviewers: bgamari, alanz, harpocrates, alexbiehl, hvr Subscribers: Tritlo, Fuuzetsu, thomie, rwbarton, mpickering, carter, wz1000, harpocrates, gershomb, hvr, alexbiehl GHC Trac Issues: #15786 Differential Revision: https://phabricator.haskell.org/D5067
Summary: This extends my work from D4758 and enables haddock to generate docs from information enclosed in the `.hi` interface files. * `HaddockLex` contains an Alex-based lexer for docstrings that detects identifiers delimited with `'` or backticks. * `HsDoc.Docs` comprises the `DeclDocMap` and `ArcDocMap` structures added in D4758 and other data needed by haddock. * haddock now uses `GhcMake.load'` to load `.hi`-files, hooking into GHC's recompilation avoidance. In order to avoid recompilation when a `.hi`-file already contains documentation we use a new option `Opt_SkipIfaceVersionCheck`. * [ ] Work out a specification for a deterministic module structure (`docs_structure`) and update the existing code to implement it. The `HaddockIssue849` test case is currently flaky because the ordering of constructors in the `Avail` for `Maybe` fluctuates. * [ ] Possibly fuse `mi_exports` and `docs_structure`. Currently both serialize the same `Avails`. * [ ] Get the recompilation avoidance right: While some of the checks performed in `checkVersions` are irrelevant for haddock, we may want to keep some of them. We probably also want `-haddock` to cause recompilation if an existing `.hi`-file doesn't contain the `Docs`. * [ ] Fix the tests. `./validate` currently reports failures for `TEST="HaddockIssue849 ImpSafeOnly01 ImpSafeOnly02 ImpSafeOnly03 ImpSafeOnly04 ImpSafeOnly05 ImpSafeOnly06 ImpSafeOnly07 ImpSafeOnly08 ImpSafeOnly09 ImpSafeOnly10 Splices T13168 T14304 T4029 T9881 break006 break011 break013 break024 cabal01 dynamicToo002 dynamicToo005 haddock.base haddock.compiler hist001 hist002 plugins09 plugins11 print026 safePkg01"` Several more (minor) issues are marked `TODO` in the source code. --- The corresponding changes in haddock are [here](haskell/haddock#906). * Add an option to configure the identifier delimiters the lexer looks for. * Add an option to make the lexer exclude birdtracks. * Make the `:doc` command also pretty-print arg docs. Reviewers: bgamari, alanz, harpocrates, alexbiehl, hvr Subscribers: Tritlo, Fuuzetsu, thomie, rwbarton, mpickering, carter, wz1000, harpocrates, gershomb, hvr, alexbiehl GHC Trac Issues: #15786 Differential Revision: https://phabricator.haskell.org/D5067
Summary: This extends my work from D4758 and enables haddock to generate docs from information enclosed in the `.hi` interface files. * `HaddockLex` contains an Alex-based lexer for docstrings that detects identifiers delimited with `'` or backticks. * `HsDoc.Docs` comprises the `DeclDocMap` and `ArcDocMap` structures added in D4758 and other data needed by haddock. * haddock now uses `GhcMake.load'` to load `.hi`-files, hooking into GHC's recompilation avoidance. In order to avoid recompilation when a `.hi`-file already contains documentation we use a new option `Opt_SkipIfaceVersionCheck`. * [ ] Work out a specification for a deterministic module structure (`docs_structure`) and update the existing code to implement it. The `HaddockIssue849` test case is currently flaky because the ordering of constructors in the `Avail` for `Maybe` fluctuates. * [ ] Possibly fuse `mi_exports` and `docs_structure`. Currently both serialize the same `Avails`. * [ ] Get the recompilation avoidance right: While some of the checks performed in `checkVersions` are irrelevant for haddock, we may want to keep some of them. We probably also want `-haddock` to cause recompilation if an existing `.hi`-file doesn't contain the `Docs`. * [ ] Fix the tests. `./validate` currently reports failures for `TEST="HaddockIssue849 ImpSafeOnly01 ImpSafeOnly02 ImpSafeOnly03 ImpSafeOnly04 ImpSafeOnly05 ImpSafeOnly06 ImpSafeOnly07 ImpSafeOnly08 ImpSafeOnly09 ImpSafeOnly10 Splices T13168 T14304 T4029 T9881 break006 break011 break013 break024 cabal01 dynamicToo002 dynamicToo005 haddock.base haddock.compiler hist001 hist002 plugins09 plugins11 print026 safePkg01"` Several more (minor) issues are marked `TODO` in the source code. --- The corresponding changes in haddock are [here](haskell/haddock#906). * Add an option to configure the identifier delimiters the lexer looks for. * Add an option to make the lexer exclude birdtracks. * Make the `:doc` command also pretty-print arg docs. Reviewers: bgamari, alanz, harpocrates, alexbiehl, hvr Subscribers: Tritlo, Fuuzetsu, thomie, rwbarton, mpickering, carter, wz1000, harpocrates, gershomb, hvr, alexbiehl GHC Trac Issues: #15786 Differential Revision: https://phabricator.haskell.org/D5067
Summary: This extends my work from D4758 and enables haddock to generate docs from information enclosed in the `.hi` interface files. * `HaddockLex` contains an Alex-based lexer for docstrings that detects identifiers delimited with `'` or backticks. * `HsDoc.Docs` comprises the `DeclDocMap` and `ArcDocMap` structures added in D4758 and other data needed by haddock. * haddock now uses `GhcMake.load'` to load `.hi`-files, hooking into GHC's recompilation avoidance. In order to avoid recompilation when a `.hi`-file already contains documentation we use a new option `Opt_SkipIfaceVersionCheck`. * [ ] Work out a specification for a deterministic module structure (`docs_structure`) and update the existing code to implement it. The `HaddockIssue849` test case is currently flaky because the ordering of constructors in the `Avail` for `Maybe` fluctuates. * [ ] Possibly fuse `mi_exports` and `docs_structure`. Currently both serialize the same `Avails`. * [ ] Get the recompilation avoidance right: While some of the checks performed in `checkVersions` are irrelevant for haddock, we may want to keep some of them. We probably also want `-haddock` to cause recompilation if an existing `.hi`-file doesn't contain the `Docs`. * [ ] Fix the tests. `./validate` currently reports failures for `TEST="HaddockIssue849 ImpSafeOnly01 ImpSafeOnly02 ImpSafeOnly03 ImpSafeOnly04 ImpSafeOnly05 ImpSafeOnly06 ImpSafeOnly07 ImpSafeOnly08 ImpSafeOnly09 ImpSafeOnly10 Splices T13168 T14304 T4029 T9881 break006 break011 break013 break024 cabal01 dynamicToo002 dynamicToo005 haddock.base haddock.compiler hist001 hist002 plugins09 plugins11 print026 safePkg01"` Several more (minor) issues are marked `TODO` in the source code. --- The corresponding changes in haddock are [here](haskell/haddock#906). * Add an option to configure the identifier delimiters the lexer looks for. * Add an option to make the lexer exclude birdtracks. * Make the `:doc` command also pretty-print arg docs. Reviewers: bgamari, alanz, harpocrates, alexbiehl, hvr Subscribers: Tritlo, Fuuzetsu, thomie, rwbarton, mpickering, carter, wz1000, harpocrates, gershomb, hvr, alexbiehl GHC Trac Issues: #15786 Differential Revision: https://phabricator.haskell.org/D5067
Summary: This extends my work from D4758 and enables haddock to generate docs from information enclosed in the `.hi` interface files. ## Main changes * `HaddockLex` contains an Alex-based lexer for docstrings that detects identifiers delimited with `'` or backticks. * `HsDoc.Docs` comprises the `DeclDocMap` and `ArcDocMap` structures added in D4758 and other data needed by haddock. * haddock now uses `GhcMake.load'` to load `.hi`-files, hooking into GHC's recompilation avoidance. In order to avoid recompilation when a `.hi`-file already contains documentation we use a new option `Opt_SkipIfaceVersionCheck`. ## TODOs and requests for comment * [ ] Work out a specification for a deterministic module structure (`docs_structure`) and update the existing code to implement it. The `HaddockIssue849` test case is currently flaky because the ordering of constructors in the `Avail` for `Maybe` fluctuates. See [haddock#956](haskell/haddock#956). * [ ] Possibly fuse `mi_exports` and `docs_structure`. Currently both serialize the same `Avails`. Also discussed at [haddock#956](haskell/haddock#956). * [ ] Get the recompilation avoidance right: While some of the checks performed in `checkVersions` are irrelevant for haddock, we may want to keep some of them. We probably also want `-haddock` to cause recompilation if an existing `.hi`-file doesn't contain the `Docs`. * [ ] Fix the tests. `./validate` currently reports failures for `TEST="HaddockIssue849 ImpSafeOnly01 ImpSafeOnly02 ImpSafeOnly03 ImpSafeOnly04 ImpSafeOnly05 ImpSafeOnly06 ImpSafeOnly07 ImpSafeOnly08 ImpSafeOnly09 ImpSafeOnly10 Splices T13168 T14304 T4029 T9881 break006 break011 break013 break024 cabal01 dynamicToo002 dynamicToo005 haddock.base haddock.compiler hist001 hist002 plugins09 plugins11 print026 safePkg01"` * [ ] Serialize instance locations. Discussed at [haddock#921](haskell/haddock#921). Several more (minor) issues are marked `TODO` in the source code. --- The corresponding changes in haddock are [here](haskell/haddock#906). ## Possible further work * Add an option to configure the identifier delimiters the lexer looks for. * Add an option to make the lexer exclude birdtracks. * Make the `:doc` command also pretty-print arg docs. Reviewers: bgamari, alanz, harpocrates, alexbiehl, hvr Subscribers: Tritlo, Fuuzetsu, thomie, rwbarton, mpickering, carter, wz1000, harpocrates, gershomb, hvr, alexbiehl GHC Trac Issues: #15786 Differential Revision: https://phabricator.haskell.org/D5067
Summary: This extends my work from D4758 and enables haddock to generate docs from information enclosed in the `.hi` interface files. * `HaddockLex` contains an Alex-based lexer for docstrings that detects identifiers delimited with `'` or backticks. * `HsDoc.Docs` comprises the `DeclDocMap` and `ArcDocMap` structures added in D4758 and other data needed by haddock. * haddock now uses `GhcMake.load'` to load `.hi`-files, hooking into GHC's recompilation avoidance. In order to avoid recompilation when a `.hi`-file already contains documentation we use a new option `Opt_SkipIfaceVersionCheck`. * [ ] Work out a specification for a deterministic module structure (`docs_structure`) and update the existing code to implement it. The `HaddockIssue849` test case is currently flaky because the ordering of constructors in the `Avail` for `Maybe` fluctuates. See [haddock#956](haskell/haddock#956). * [ ] Possibly fuse `mi_exports` and `docs_structure`. Currently both serialize the same `Avails`. Also discussed at [haddock#956](haskell/haddock#956). * [ ] Get the recompilation avoidance right: While some of the checks performed in `checkVersions` are irrelevant for haddock, we may want to keep some of them. We probably also want `-haddock` to cause recompilation if an existing `.hi`-file doesn't contain the `Docs`. * [ ] Fix the tests. `./validate` currently reports failures for `TEST="HaddockIssue849 ImpSafeOnly01 ImpSafeOnly02 ImpSafeOnly03 ImpSafeOnly04 ImpSafeOnly05 ImpSafeOnly06 ImpSafeOnly07 ImpSafeOnly08 ImpSafeOnly09 ImpSafeOnly10 Splices T13168 T14304 T4029 T9881 break006 break011 break013 break024 cabal01 dynamicToo002 dynamicToo005 haddock.base haddock.compiler hist001 hist002 plugins09 plugins11 print026 safePkg01"` * [ ] Serialize instance locations. Discussed at [haddock#921](haskell/haddock#921). Several more (minor) issues are marked `TODO` in the source code. --- The corresponding changes in haddock are [here](haskell/haddock#906). * Add an option to configure the identifier delimiters the lexer looks for. * Add an option to make the lexer exclude birdtracks. * Make the `:doc` command also pretty-print arg docs. Reviewers: bgamari, alanz, harpocrates, alexbiehl, hvr Subscribers: Tritlo, Fuuzetsu, thomie, rwbarton, mpickering, carter, wz1000, harpocrates, gershomb, hvr, alexbiehl GHC Trac Issues: #15786 Differential Revision: https://phabricator.haskell.org/D5067
Merge ghc-head into wip/hi-haddock
What is the status of this? |
It's good that you're asking, @bgamari. !1648 reminded me of some pretty cool work by @harpocrates among the other Hi Haddock stuff that resulted in proper haddocks for I had got stuck on #921 last winter, and had little time for this project. In March I ended up asking @harpocrates to take over the remaining work. Back then I was under the impression that there were still quite a few tricky (tricky for me) issues to resolve. AFAIK the latest TODO list is this one. What made everything more difficult was the need to sync (and rebase) things between haddock and ghc. I'm wondering whether there could be a way to merge parts of the work incrementally, reducing the amount of changes outside of master that have to be kept in sync. @harpocrates what's your perspective on all this these days? |
Sorry, I'm definitely at fault for dragging my feet on this. I thought I'd negotiated 2 weeks of paid time for this with my employer last April, but that ended up not panning out. Lately I have a bit more time - perhaps even as early as this month...
|
What is our current status? Is there a way to better split this PR? |
Hi! As of today, patches for the |
(GSoC project description)
What already works
For many packages we can already generate reasonably-looking haddocks. For example see these haddocks for lens.
TODOs
GetFixed by @harpocrates in 29edbb9.html-test
to run. Currently we can't handle theBug294
test-case. This requires changes inextractDecl
. (Details)Scrutinize output changes and update the tests. In particular we currently generate kind signatures for all higher-kinded type variables. (Details)
Fix
--hyperlinked-source
by integrating Zubin Duggal's GSoC project.Warnings for ambiguous identfiers are too noisy. (Details)
A few more smaller issues are marked
TODO
in the source code.The corresponding changes in GHC are on Phabricator.