This repository has been archived by the owner on Aug 3, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
As part of the
ghc-9.0
branch, a fix was introduced to keep theignore-exports
option working, but this fix was mistakenly dropped in later branches. Furthermore, the test introduced in #1082 to prevent regressions was also broken at a later point. This PR reintroduces the fix, fixes the old HTML test, and introduces a new hoogle test.This PR targets 9.4; #1532 is a similar PR for 9.2. I don't know, however, how to ensure that this fixes also lands on
main
(orghc-head
?), and how to prevent the tests from just being ignored or "fixed" in the future.Implementation
The
fullModuleContents
function iterates on all declarations of the module, but only keeps declarations for which it finds anAvailInfo
, obtained from GHC's type-checker's output (seetcg_exports
). However, that list only contains theAvailInfo
information for declarations that are exported out of the module. To prevent non-exported declarations from being ignored when we actually request them, this PR takes the same approach as b93c635 and crafts a simpleAvailInfo
for each declaration to be used in lieu of the rawtcg_exports
list.Steps to verify
See #1531 for a repro case.
Caveats
This PR bumps the dependency version of
haddock-api
to 2.27.1, as that is the version in that branch; without that, this branch doesn't compile.