Fix a crash when linking to a symbol that doesn't have a page #617
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://110177531
Summary
This fixes a crash when writing a symbol link to a symbol that doesn't have a page.
The hierarchy based link resolver used to assume that every symbol from the symbol graph files could be linked to but that isn't true. Some default implementation symbols don't have pages in the documentation build and aren't available for linking.
With this change, the link resolver detects that there is no page for the found symbol and raises a specific error message.
Dependencies
None
Testing
In a project where extension symbols are disabled (
DOCC_EXTRACT_EXTENSION_SYMBOLS = NO
in Xcode,--exclude-extended-types
with the Swift-DocC pluginExtend an external protocol with a new public symbol. For example
Link to the symbol on the extended type. For example
Instead of crashing, DocC should warn that the symbol has no page and isn't available for linking.
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded[ ] Updated documentation if necessary