Skip to main content

Module utf16

Module utf16 

Source
Expand description

Map UTF-8 byte offsets to LSP positions (UTF-16 code units).

Functionsยง

byte_offset_to_position
Convert a UTF-8 byte index in source to LSP (line, character) with UTF-16 character.
byte_range_to_lsp_range
Byte range (start inclusive, end exclusive) to LSP (line, char) pairs.
point_range_to_lsp_range
Map tree-sitter Point to byte offset then to LSP range.