Skip to content

Commit 714ff2a

Browse files
committed
Adjustment because trimmedRange is not available in swift-syntax release/6.0
1 parent 18fd0a7 commit 714ff2a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/SourceKitLSP/Swift/CodeActions/ConvertJSONToCodableStruct.swift

+4-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ public struct ConvertJSONToCodableStruct: EditRefactoringProvider {
110110
// Closures are replaced entirely, since they were invalid code to
111111
// start with.
112112
return [
113-
SourceEdit(range: closure.trimmedRange, replacement: decls.description)
113+
SourceEdit(
114+
range: closure.positionAfterSkippingLeadingTrivia..<closure.endPositionBeforeTrailingTrivia,
115+
replacement: decls.description
116+
)
114117
]
115118
case .endingClosure(let closure, let unexpected):
116119
// Closures are replaced entirely, since they were invalid code to

0 commit comments

Comments
 (0)