Include symbols without common lang in navigator #1269
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.
Bug/issue #, if applicable:
rdar://155522179
Summary
The Topics section has a filtering logic to ensure that it displays the correct variant of a referenced symbol (e.g. the Objective-C variant of the symbol is shown only for the Objective-C version of a page). If the page and symbol have no languages in common, the symbol will be shown anyway in order to not drop the reference completely. For example, if a Swift-only symbol is curated under an Objective-C only page, the symbol will be shown in the Topics section even though their languages don't match.
The navigator also has a similar filtering logic to display all references present in the Topics section. However, it drops a reference if the pages don't have any source languages in common. This results in cases where the navigator is incorrectly missing references that are present in the Topics section. This issue can be reproduced with the
MixedLanguageFrameworkSingleLanguageCuration.docc
test bundle by runningxcrun docc preview Tests/SwiftDocCTests/Test\ Bundles/MixedLanguageFrameworkSingleLanguageCuration.docc
and viewing the navigator in the preview.This patch updates the navigator's filtering logic to include references if they do not share a common language with the relevant page.
Dependencies
None
Testing
swift docc preview Tests/SwiftDocCTests/Test\ Bundles/MixedLanguageFrameworkSingleLanguageCuration.docc
SwiftOnlyStruct2
.Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded