@tikoci/centrs
    Preparing search index...

    Function byteSpanToRange

    • 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.

      Parameters

      Returns Range