Function textedit_merge::merge
source · [−]pub fn merge<T: AsRef<str>>(
edits1: &[(Range<usize>, T)],
edits2: &[(Range<usize>, T)]
) -> Vec<(Range<usize>, String)>
Expand description
Merges two lists of textedits.
The two inputs must be individually non-overlapping and sorted. Ranges of individual edits in
edits1
refer to positions in the original document, and ranges in edits2
refer to positions
in the document after edits1
has been applied. Both inputs’ edits move the document from the
before state to the after state without describing intermediate state. For a more detailed
explanation of the required format, refer to the language server protocol specification.
Returns a vector of edits that, when applied to the original document, move it from the state
before edits1
was applied to the state after edits2
was applied in one step.