Skip to content

Commit ecbd7df

Browse files
authored
Merge pull request swiftlang#2517 from mustiikhalil/fix-source-edit-length-value
(fix): Bug where length return is negative
2 parents cd9a97f + f94cf90 commit ecbd7df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SwiftSyntax/SourceEdit.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public struct SourceEdit: Equatable, Sendable {
2121
/// Length of the original source range that this edit applies to. Zero if
2222
/// this is an addition.
2323
public var length: SourceLength {
24-
return SourceLength(utf8Length: range.lowerBound.utf8Offset - range.upperBound.utf8Offset)
24+
return SourceLength(utf8Length: range.upperBound.utf8Offset - range.lowerBound.utf8Offset)
2525
}
2626

2727
/// Create an edit to replace `range` in the original source with

0 commit comments

Comments
 (0)