Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions lib/ASTGen/Sources/ASTGen/DiagnosticsBridge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ fileprivate func emitDiagnosticParts(
replaceEndLoc = bridgedSourceLoc(at: oldToken.endPosition)
newText = newTrivia.description

case .replaceChild(let replacingChildData):
let replacementRange = replacingChildData.replacementRange
replaceStartLoc = bridgedSourceLoc(at: replacementRange.lowerBound)
replaceEndLoc = bridgedSourceLoc(at: replacementRange.upperBound)
newText = replacingChildData.newChild.description

#if RESILIENT_SWIFT_SYNTAX
@unknown default:
fatalError()
Expand Down Expand Up @@ -221,6 +227,18 @@ extension SourceManager {
)
newText = newTrivia.description

case .replaceChild(let replacingChildData):
let replacementRange = replacingChildData.replacementRange
replaceStartLoc = bridgedSourceLoc(
for: replacingChildData.parent,
at: replacementRange.lowerBound
)
replaceEndLoc = bridgedSourceLoc(
for: replacingChildData.parent,
at: replacementRange.upperBound
)
newText = replacingChildData.newChild.description

#if RESILIENT_SWIFT_SYNTAX
@unknown default:
fatalError()
Expand Down