Skip to main content

byte_offset_to_position

Function byte_offset_to_position 

Source
pub fn byte_offset_to_position(source: &str, byte_idx: usize) -> (u32, u32)
Expand description

Convert a UTF-8 byte index in source to LSP (line, character) with UTF-16 character.