Skip to main content

apply_edits

Function apply_edits 

Source
pub fn apply_edits(old: &str, edits: &[Edit]) -> String
Expand description

Apply edits to old left-to-right, each expressed against the text its predecessors produced — the shape an LSP didChange batch arrives in.

§Panics

If any edit does not fit the text its predecessors produced. Use try_apply_edits for a chain of unproven provenance.