-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add successfully resolved external references to reference index #582
Add successfully resolved external references to reference index #582
Conversation
rdar://108974747
@swift-ci please test |
@@ -206,11 +206,17 @@ struct RenderContentCompiler: MarkupVisitor { | |||
} | |||
|
|||
mutating func resolveTopicReference(_ destination: String) -> ResolvedTopicReference? { | |||
if let cached = context.referenceIndex[destination] { | |||
if let cached = context.referenceIndex[destination] { | |||
if let node = context.topicGraph.nodeWithReference(cached), !context.topicGraph.isLinkable(node.reference) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the change here needed? Was it just missing before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that it was needed because the code below does it but now that I think about it I also think that the link resolution would have already done this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, only MarkupReferenceResolver
filters references that are linkable so I guess it's possible for the context to have resolved and saved a reference that isn't linkable.
So in order for the cached and non-cached code paths to behave the same, the cached code path should also check that the reference is linkable.
Co-authored-by: Ethan Kusters <ekusters@apple.com>
@swift-ci please test |
…ftlang#582) * Add successfully resolved external references to reference index rdar://108974747 * Undo accidental whitespace change Co-authored-by: Ethan Kusters <ekusters@apple.com>
… (#584) * Add successfully resolved external references to reference index rdar://108974747 * Undo accidental whitespace change Co-authored-by: Ethan Kusters <ekusters@apple.com>
Bug/issue #, if applicable: rdar://108974747
Summary
This change tracks successfully resolved external references the same as successfully resolved local references, enabling them to be looked up in the reference index without going through the link resolution code path again.
Dependencies
None.
Testing
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