Skip to main content

lsp_character_to_byte

Function lsp_character_to_byte 

Source
pub fn lsp_character_to_byte(
    line: &str,
    character: u32,
    encoding: &PositionEncodingKind,
) -> u32
Expand description

Convert an LSP character value (in the negotiated encoding) to a UTF-8 byte offset within line. Used for ranges that arrive FROM the server (definitions, diagnostics, etc.).