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
Fix a few mismatches between the two link resolver implementations (#375)
* Avoid reporting mismatches for symbols that won't have pages
* Avoid traversing symbols that are not in the symbol index
* Handle collisions that only occur when symbol names are mapped to file names
* Don't add default implementation symbols to the target's parent path
* Fix a data race when gathering link resolution mismatches.
Also, avoid percent encoding in the gathered info.
* Fix incorrect behaviors when both link resolvers run to gather mismatches
* Remove real file paths in test data
* Combine two consecutive if-statements with same condition.
rdar://99891308
// Only add the symbol mapping now if the path hierarchy based resolver is the main implementation.
1279
+
// If it is only used for mismatch checking then we must wait until the documentation cache code path has traversed and updated all the colliding nodes.
1280
+
// Otherwise the mappings will save the unmodified references and the hierarchy based resolver won't find the expected parent nodes when resolving links.
if hierarchyBasedLinkResolver ==nil || LinkResolutionMigrationConfiguration.shouldReportLinkResolutionMismatches {
@@ -1311,20 +1313,22 @@ public class DocumentationContext: DocumentationContextDataProviderDelegate {
1311
1313
})
1312
1314
}
1313
1315
1314
-
1315
1316
// Only update the nodes and symbol index when using the documentation cache-based link resolver otherwise the context will end up in an inconsistent state.
// Attempting to use the The documentation cache based link resolver to compute the disambiguated symbol paths when it is not in full control of the symbol index,
1329
1333
// topic graph, and documentation cache will result in the wrong behavior. The issues range from incorrectly computed paths to precondition failures.
1330
1334
//
@@ -1337,7 +1341,7 @@ public class DocumentationContext: DocumentationContextDataProviderDelegate {
1337
1341
// Luckily the path hierarchy describe the hierarchical relationships between the symbols in a way where it's possible to get the `Symbol.Identifier` for each symbol.
1338
1342
// By sorting the pairs of `(symbol, parent symbol)` by the symbol's number of path components it's possible to traverse the hierarchy breath first and update the initial disambiguated
1339
1343
// paths from the documentation cache based link resolver so that each child path matches the disambiguation from the parent path.
0 commit comments