Expand description
Shared source text position helpers.
The parser and lexer report diagnostics in byte offsets, while humans and editor protocols need line/column coordinates. This crate keeps that mapping in one place without depending on LSP types or parser internals.
Structs§
- Line
Column - A one-based human-readable source position.
- Line
Index - Maps byte offsets into a source string to line/column coordinates.
- Utf8
Position - A zero-based LSP-style position whose character offset is measured in UTF-8 bytes.
- Utf16
Position - A zero-based LSP-style position whose character offset is measured in UTF-16 code units.
Functions§
- utf16_
len - Count UTF-16 code units in
text.