You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Index external entities after local entities (#1328)
The navigation indexing code skips all further nodes after it has already indexed a node with a given identifier [1].
This can result in an odd interaction when there is an external link which is resolved to a path that the bundle serves itself (or more colloquially, a catalog has an external link to itself).
Since external entities are indexed before local entities, they were always be preferred over local entities, resulting in local entities mistakenly being dropped from the navigator altogether.
The resulting navigator is incorrect and missing nodes, due to external entities not having hierarchy information.
This issue was introduced when support for external links in the navigator was introduced.
This commit updates `ConvertActionConverter` to always index local entities first.
If any external entities clash with local entities, they will be resolved as the local entity (including its hierarchy) in the navigator.
Fixes rdar://163018922.
[1]: https://github.com/swiftlang/swift-docc/blob/b27288dd99b0e2715ed1a2d5720cd0f23118c030/Sources/SwiftDocC/Indexing/Navigator/NavigatorIndex.swift#L711-L713
[2]: 65aaf92
This is an internal article with an external link <doc://\(externalResolver.bundleID)/documentation/TestBundle/SampleClass> which clashes with the curated local link.
520
+
521
+
External links in content should not affect the navigator.
522
+
523
+
## Topics
524
+
525
+
- ``SampleClass``
526
+
"""),
527
+
TextFile(name:"SampleClass.md", utf8Content:"""
528
+
# ``SampleClass``
529
+
530
+
This extends the documentation for this symbol.
531
+
532
+
## Topics
533
+
534
+
- <doc:ChildArticleA>
535
+
- <doc:ChildArticleB>
536
+
"""),
537
+
TextFile(name:"ChildArticleA.md", utf8Content:"""
538
+
# ChildArticleA
539
+
540
+
A child article.
541
+
"""),
542
+
TextFile(name:"ChildArticleB.md", utf8Content:"""
543
+
# ChildArticleB
544
+
545
+
A child article.
546
+
"""),
547
+
// Symbol graph with a class that matches an external link path
0 commit comments