Skip to main content

LinePosToOffset

pub fn LinePosToOffset(
    LineOffsets: &[usize],
    Source: &str,
    Line: usize,
    Character: usize,
) -> usize
Expand description

Resolve (line, character) to an absolute byte offset in Source. character is counted in UTF-16 code units to match VS Code’s Range/Position semantics. Falls back to EOF when line/character exceeds the source length.