Skip to content

Commit

Permalink
Use "bundle id" in local variable in fallback resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
d-ronnqvist committed Nov 21, 2024
1 parent f97e6d3 commit 9478d47
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ private final class FallbackResolverBasedLinkResolver {

private func resolve(_ unresolvedReference: UnresolvedTopicReference, in parent: ResolvedTopicReference, fromSymbolLink isCurrentlyResolvingSymbolLink: Bool, context: DocumentationContext) -> TopicReferenceResolutionResult? {
// Check if a fallback reference resolver should resolve this
let referenceID = unresolvedReference.bundleID ?? parent.bundleID
let referenceBundleID = unresolvedReference.bundleID ?? parent.bundleID
guard let fallbackResolver = context.configuration.convertServiceConfiguration.fallbackResolver,
// This uses an underscored internal variant of `registeredBundles` to avoid deprecation warnings and remain compatible with legacy data providers.
let knownBundleID = context._registeredBundles.first(where: { $0.id == referenceID || urlReadablePath($0.displayName) == referenceID.rawValue })?.id,
let knownBundleID = context._registeredBundles.first(where: { $0.id == referenceBundleID || urlReadablePath($0.displayName) == referenceBundleID.rawValue })?.id,
fallbackResolver.bundleID == knownBundleID
else {
return nil
Expand All @@ -184,7 +184,7 @@ private final class FallbackResolverBasedLinkResolver {
var allCandidateURLs = [URL]()

let alreadyResolved = ResolvedTopicReference(
bundleID: referenceID,
bundleID: referenceBundleID,
path: unresolvedReference.path.prependingLeadingSlash,
fragment: unresolvedReference.topicURL.components.fragment,
sourceLanguages: parent.sourceLanguages
Expand Down

0 comments on commit 9478d47

Please sign in to comment.