We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
trimmedRange
release/6.0
1 parent 18fd0a7 commit 714ff2aCopy full SHA for 714ff2a
Sources/SourceKitLSP/Swift/CodeActions/ConvertJSONToCodableStruct.swift
@@ -110,7 +110,10 @@ public struct ConvertJSONToCodableStruct: EditRefactoringProvider {
110
// Closures are replaced entirely, since they were invalid code to
111
// start with.
112
return [
113
- SourceEdit(range: closure.trimmedRange, replacement: decls.description)
+ SourceEdit(
114
+ range: closure.positionAfterSkippingLeadingTrivia..<closure.endPositionBeforeTrailingTrivia,
115
+ replacement: decls.description
116
+ )
117
]
118
case .endingClosure(let closure, let unexpected):
119
0 commit comments