xsbti.Position: add startOffset and endOffset

A position now has a start, an end, and a point (the existing `offset`),
just like it does in the Scala compiler. This information is especially
useful for displaying squiggly lines in an IDE.

This commit and the next one are required for https://github.com/sbt/zinc/pull/571
This commit is contained in:
Guillaume Martres
2018-08-14 02:04:43 +09:00
parent f457696a99
commit 78834527df
3 changed files with 34 additions and 2 deletions
@@ -18,4 +18,8 @@ public interface Position
Optional<String> sourcePath();
Optional<File> sourceFile();
// Default values to avoid breaking binary compatibility
default Optional<Integer> startOffset() { return Optional.empty(); }
default Optional<Integer> endOffset() { return Optional.empty(); }
}