pub struct TextEdit {
pub span: Range<usize>,
pub text: String,
}Expand description
Represents a text edit operation for incremental updates.
Text edits are used to apply changes to source text in an incremental manner, such as those received from LSP clients or other text editing operations. Each edit specifies a byte range to replace and the new text to insert in that range.
§Examples
let edit = TextEdit {
span: 4..9, // Replace characters at positions 4-8
text: "world".into(), // With the text "world"
};Fields§
§span: Range<usize>The byte range in the original text to be replaced (start..end)
text: StringThe new text to insert in place of the specified range
Auto Trait Implementations§
impl Freeze for TextEdit
impl RefUnwindSafe for TextEdit
impl Send for TextEdit
impl Sync for TextEdit
impl Unpin for TextEdit
impl UnwindSafe for TextEdit
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