Skip to main content

selection_ranges

Function selection_ranges 

Source
pub fn selection_ranges(
    source: &str,
    positions: &[Position],
) -> Vec<SelectionRange>
Expand description

textDocument/selectionRange — for each position, the chain of enclosing AST node ranges, innermost first (each .parent widens outward to the file). Falls back to an empty range at the cursor when no node contains it (e.g. trailing whitespace) or the file doesn’t parse.