pub struct TextEdit {
pub text: String,
pub range: TextRange,
pub snippet: Option<String>,
}
Expand description
A text edit (with an optional snippet - i.e tab stops and/or placeholders).
Fields§
§text: String
Replacement text for the text edit.
range: TextRange
Range to which the text edit will be applied.
snippet: Option<String>
Formatted snippet for the text edit (includes tab stops and/or placeholders).
Implementations§
Source§impl TextEdit
impl TextEdit
Sourcepub fn insert(text: String, offset: TextSize) -> Self
pub fn insert(text: String, offset: TextSize) -> Self
Creates text edit for inserting at the given offset.
Sourcepub fn insert_with_snippet(
text: String,
offset: TextSize,
snippet: Option<String>,
) -> Self
pub fn insert_with_snippet( text: String, offset: TextSize, snippet: Option<String>, ) -> Self
Creates text edit for inserting at the given offset (including an optional snippet).
Sourcepub fn replace(text: String, range: TextRange) -> Self
pub fn replace(text: String, range: TextRange) -> Self
Creates text edit for replacing the given range.
Trait Implementations§
impl Eq for TextEdit
impl StructuralPartialEq for TextEdit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.