Skip to content
This repository has been archived by the owner. It is now read-only.

Commit caeca9f

Browse files
committed
xsbti.Position: Also add {start,end}{Line,Column}
Positions in the Language Server Protocol and Build Server Protocol are line/column-based instead of offset-based, so this is more convenient. Computing the line/column from the offset is possible but requires reading the source file.
1 parent 55831a4 commit caeca9f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/xsbti/Position.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ public interface Position
2222
// Default values to avoid breaking binary compatibility
2323
default Optional<Integer> startOffset() { return Optional.empty(); }
2424
default Optional<Integer> endOffset() { return Optional.empty(); }
25+
default Optional<Integer> startLine() { return Optional.empty(); }
26+
default Optional<Integer> startColumn() { return Optional.empty(); }
27+
default Optional<Integer> endLine() { return Optional.empty(); }
28+
default Optional<Integer> endColumn() { return Optional.empty(); }
2529
}

0 commit comments

Comments
 (0)