pub struct TextEdit {
pub range: SourceSpan,
pub new_text: String,
}Expand description
A text edit (replacement) for quick fixes.
Fields§
§range: SourceSpanThe range to replace
new_text: StringNew text to insert
Implementations§
Source§impl TextEdit
impl TextEdit
Sourcepub fn new(range: SourceSpan, new_text: impl Into<String>) -> Self
pub fn new(range: SourceSpan, new_text: impl Into<String>) -> Self
Create a new text edit.
Sourcepub fn insert(
file: impl Into<PathBuf>,
line: u32,
col: u32,
text: impl Into<String>,
) -> Self
pub fn insert( file: impl Into<PathBuf>, line: u32, col: u32, text: impl Into<String>, ) -> Self
Create an insertion at a point.
Sourcepub fn delete(range: SourceSpan) -> Self
pub fn delete(range: SourceSpan) -> Self
Create a deletion of a range.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TextEdit
impl<'de> Deserialize<'de> for TextEdit
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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