Skip to content

Commit

Permalink
remove offsets.rangeLessThan
Browse files Browse the repository at this point in the history
  • Loading branch information
Techatrix committed Jan 6, 2025
1 parent 5fd889d commit f961c8b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion src/diff.zig
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub fn applyContentChanges(
// https://cs.opensource.google/go/x/tools/+/master:internal/lsp/diff/diff.go;l=40

fn textEditLessThan(_: void, lhs: types.TextEdit, rhs: types.TextEdit) bool {
return offsets.rangeLessThan(lhs.range, rhs.range);
return offsets.positionLessThan(lhs.range.start, rhs.range.start) or offsets.positionLessThan(lhs.range.end, rhs.range.end);
}

/// Caller owns returned memory.
Expand Down
4 changes: 0 additions & 4 deletions src/offsets.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1046,10 +1046,6 @@ fn testGetNCodeUnitByteCount(text: []const u8, n: [3]usize) !void {
try std.testing.expectEqual(n[0], getNCodeUnitByteCount(text, n[2], .@"utf-32"));
}

pub fn rangeLessThan(a: types.Range, b: types.Range) bool {
return positionLessThan(a.start, b.start) or positionLessThan(a.end, b.end);
}

pub fn positionLessThan(a: types.Position, b: types.Position) bool {
if (a.line < b.line) {
return true;
Expand Down

0 comments on commit f961c8b

Please sign in to comment.