diff --git a/Sources/SourceKitLSP/Swift/DocumentFormatting.swift b/Sources/SourceKitLSP/Swift/DocumentFormatting.swift index d4af05157..9987ebcc8 100644 --- a/Sources/SourceKitLSP/Swift/DocumentFormatting.swift +++ b/Sources/SourceKitLSP/Swift/DocumentFormatting.swift @@ -105,9 +105,11 @@ private func edits(from original: DocumentSnapshot, to edited: String) -> [TextE let sequentialEdits = difference.map { change in switch change { case .insert(offset: let offset, element: let element, associatedWith: _): - IncrementalEdit(offset: offset, length: 0, replacement: [element]) + let absolutePosition = AbsolutePosition(utf8Offset: offset) + return IncrementalEdit(range: absolutePosition..