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.
This commit is contained in:
Guillaume Martres
2018-08-14 02:04:55 +09:00
parent 78834527df
commit 5e3a102606
2 changed files with 24 additions and 4 deletions
@@ -22,4 +22,8 @@ public interface Position
// Default values to avoid breaking binary compatibility
default Optional<Integer> startOffset() { return Optional.empty(); }
default Optional<Integer> endOffset() { return Optional.empty(); }
default Optional<Integer> startLine() { return Optional.empty(); }
default Optional<Integer> startColumn() { return Optional.empty(); }
default Optional<Integer> endLine() { return Optional.empty(); }
default Optional<Integer> endColumn() { return Optional.empty(); }
}