Skip to content

Commit e561d3d

Browse files
committed
[ASTGen] Update for new FixIt.Change API in Swift-Syntax
- covered the new case in exhaustive switch statements
1 parent fe238cf commit e561d3d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lib/ASTGen/Sources/ASTGen/DiagnosticsBridge.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ fileprivate func emitDiagnosticParts(
7575
replaceEndLoc = bridgedSourceLoc(at: oldToken.endPosition)
7676
newText = newTrivia.description
7777

78+
case .replaceChild(let replacingChildData):
79+
let replacementRange = replacingChildData.replacementRange
80+
replaceStartLoc = bridgedSourceLoc(at: replacementRange.lowerBound)
81+
replaceEndLoc = bridgedSourceLoc(at: replacementRange.upperBound)
82+
newText = replacingChildData.newChild.description
83+
7884
#if RESILIENT_SWIFT_SYNTAX
7985
@unknown default:
8086
fatalError()
@@ -221,6 +227,18 @@ extension SourceManager {
221227
)
222228
newText = newTrivia.description
223229

230+
case .replaceChild(let replacingChildData):
231+
let replacementRange = replacingChildData.replacementRange
232+
replaceStartLoc = bridgedSourceLoc(
233+
for: replacingChildData.parent,
234+
at: replacementRange.lowerBound
235+
)
236+
replaceEndLoc = bridgedSourceLoc(
237+
for: replacingChildData.parent,
238+
at: replacementRange.upperBound
239+
)
240+
newText = replacingChildData.newChild.description
241+
224242
#if RESILIENT_SWIFT_SYNTAX
225243
@unknown default:
226244
fatalError()

0 commit comments

Comments
 (0)