Skip to main content

apply_semantic_token_edits

Function apply_semantic_token_edits 

Source
pub fn apply_semantic_token_edits(
    raw_data: &mut Vec<SemanticToken>,
    edits: &[SemanticTokensEdit],
) -> Result<(), ()>
Expand description

4.4.i: apply a server-issued SemanticTokensEdit script to raw_data in place. Each edit specifies a start index (into the previous token vec), a count to delete, and a replacement slice. Edits are applied in order; the server constructs them against the index space of the input vec.

Returns Err(()) and leaves raw_data untouched when an edit references a range outside the current vec (defensive guard against server bugs; the host falls back to a fresh full request when this fires).