Skip to main content

Module position

Module position 

Source
Expand description

Position conversion between LSP Position (UTF-16 code units) and Gruel byte offsets (ADR-0091).

LSP defaults to UTF-16; we also support UTF-8 (LSP 3.17 positionEncoding) to skip the conversion entirely for capable clients.

Structs§

LineMap
Cached line start byte offsets for a source string.

Enums§

PositionEncoding
Position encoding negotiated with the client.

Functions§

byte_to_position
Convert a byte offset within source to an LSP Position.
position_to_byte
Convert an LSP Position to a byte offset within source.
span_to_range
Convert a Gruel Span (within source) to an LSP Range.