Populate symbol kind in external render nodes #1251
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: N/A
Summary
Fixes the navigator page type for external render nodes such that it takes into account the kind of symbol of the node.
In order to properly determine the navigator page type for a symbol, we need to know its symbol kind:
swift-docc/Sources/SwiftDocC/Indexing/Navigator/RenderNode+NavigatorIndex.swift
Lines 148 to 168 in 65aaf92
However, the symbol kind was not available for external nodes and all items were showing as their generic role, e.g. "article" or "symbol".
This PR adds logic to derive an external render node's symbol kind:
OutOfProcessReferenceResolver.ResolvedInformation
's documentation kind toLinkResolver.ExternalEntity
, the type which is used to deal with external entities.Navigator comparison (using swift-docc-render):
The navigator icons on the right match the symbol kinds of the external pages.
The navigator
index.json
shows the correct page type as well:Dependencies
N/A.
Testing
Previewed a custom bundle locally which contained different types of external links (module, class, function and article).
index.json
looked as expectedSteps:
DOCC_LINK_RESOLVER_EXECUTABLE=Example.docc/bin/test-data-external-resolver swift run docc preview Example.docc
Example.docc/.docc-build/index/index.json
looks as expected.Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded