pub struct AppliedEdit {
pub original_range: Range,
pub inserted_range: Range,
pub replaced_text: String,
pub inserted_text: String,
}Expand description
An edit as actually applied to the buffer (the original Edit plus the
resulting range, useful for clients that want to know what changed).
The bus-level copy of lattice_core::AppliedEdit, without its
tree-sitter EditDelta. Positions are
(line, UTF-8 byte), as everywhere in this crate.
inserted_text carries the text that was placed into inserted_range.
Together with original_range this is exactly what an LSP
textDocument/didChange payload needs, which lets the
lattice-lsp fan-in synthesise a lattice_protocol::edit::Edit
from this event without re-reading the buffer.
Fields§
§original_range: RangeThe range the edit targeted, in pre-edit coordinates.
inserted_range: RangeWhere the inserted text now sits, in post-edit coordinates: starts at
original_range.start; empty for a pure delete.
replaced_text: StringThe text removed from original_range (empty for a pure insert).
inserted_text: StringThe text placed at inserted_range (empty for a pure delete).
Trait Implementations§
Source§impl Clone for AppliedEdit
impl Clone for AppliedEdit
Source§fn clone(&self) -> AppliedEdit
fn clone(&self) -> AppliedEdit
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more