Skip to content

Commit

Permalink
fixup! Resolve topic references in @AlternateRepresentation
Browse files Browse the repository at this point in the history
  • Loading branch information
anferbui committed Dec 11, 2024
1 parent 7cacf93 commit 4242b33
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions Sources/SwiftDocC/Infrastructure/DocumentationContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -619,16 +619,18 @@ public class DocumentationContext {
}

// Also resolve the node's alternate representations. This isn't part of the node's 'semantic' value (resolved above).
documentationNode.metadata?.alternateRepresentations.forEach { alternateRepresentation in
let resolutionResult = resolver.resolve(
alternateRepresentation.reference,
in: bundle.rootReference,
range: alternateRepresentation.originalMarkup.range,
severity: .warning
)
alternateRepresentation.reference = .resolved(resolutionResult)
if let alternateRepresentations = documentationNode.metadata?.alternateRepresentations {
for alternateRepresentation in alternateRepresentations {
let resolutionResult = resolver.resolve(
alternateRepresentation.reference,
in: bundle.rootReference,
range: alternateRepresentation.originalMarkup.range,
severity: .warning
)
alternateRepresentation.reference = .resolved(resolutionResult)
}
}

let problems: [Problem]
if documentationNode.semantic is Article {
// Diagnostics for articles have correct source ranges and don't need to be modified.
Expand Down

0 comments on commit 4242b33

Please sign in to comment.