Map a half-open analyzed-byte span to an original (line, col) range — the
conversion an LSP consumer needs for every defect region and every token span.
Deliberately built on byteToPosition in both directions rather than on
positionToByte: that one is an O(n) linear scan over runs, so using
it here would make converting a document's worth of spans quadratic.
byteToPosition binary-searches. Both endpoints snap to a character boundary
(V6), and end === analyzed.length is legal, so a span reaching end-of-input
converts without a special case.
Map a half-open analyzed-byte span to an original (line, col) range — the conversion an LSP consumer needs for every defect region and every token span.
Deliberately built on byteToPosition in both directions rather than on positionToByte: that one is an O(n) linear scan over
runs, so using it here would make converting a document's worth of spans quadratic.byteToPositionbinary-searches. Both endpoints snap to a character boundary (V6), andend === analyzed.lengthis legal, so a span reaching end-of-input converts without a special case.