pub struct CodeChange {
pub version: u32,
pub range: CodeRange,
pub text: String,
}Expand description
One committed edit, as the Renderer reported it.
range is in the document as it stood before the edit, and version is the version
the edit produced. The shape is a language server’s TextDocumentContentChangeEvent,
so forwarding one is a matter of copying four numbers and a string.
Fields§
§version: u32§range: CodeRange§text: StringImplementations§
Source§impl CodeChange
impl CodeChange
Sourcepub fn apply_to(&self, text: &mut String) -> bool
pub fn apply_to(&self, text: &mut String) -> bool
Applies this edit to a copy of the document the Host keeps.
Applying every change in the order they arrived, starting from the text the editor
was opened with, gives the text the reader sees. Returns false, and leaves text
alone, where the range does not fit the document, which means the copy has fallen
out of step with the editor.
Trait Implementations§
Source§impl Clone for CodeChange
impl Clone for CodeChange
Source§impl Debug for CodeChange
impl Debug for CodeChange
Source§impl PartialEq for CodeChange
impl PartialEq for CodeChange
impl StructuralPartialEq for CodeChange
Auto Trait Implementations§
impl Freeze for CodeChange
impl RefUnwindSafe for CodeChange
impl Send for CodeChange
impl Sync for CodeChange
impl Unpin for CodeChange
impl UnsafeUnpin for CodeChange
impl UnwindSafe for CodeChange
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more