Skip to main content

Crate sql_dialect_fmt_text

Crate sql_dialect_fmt_text 

Source
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§

LineColumn
A one-based human-readable source position.
LineIndex
Maps byte offsets into a source string to line/column coordinates.
Utf8Position
A zero-based LSP-style position whose character offset is measured in UTF-8 bytes.
Utf16Position
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.