pub enum FixEdit {
SetContent {
path: PathBuf,
content: Vec<u8>,
},
CreateFile {
path: PathBuf,
content: Vec<u8>,
},
DeleteFile {
path: PathBuf,
},
RenameFile {
from: PathBuf,
to: PathBuf,
},
}Expand description
A proposed fix expressed as data, so a caller can turn it into an
editor edit (an LSP WorkspaceEdit) instead of writing the file.
Returned by Fixer::fix_edit. Paths are relative to the alint
root, matching Violation::path.
fix_edit is the non-writing sibling of Fixer::apply: apply
mutates the filesystem (for alint fix); fix_edit describes the
same change so the editor can apply it to the buffer (with undo).
Variants§
SetContent
Replace the full contents of an existing file.
CreateFile
Create a file that doesn’t exist yet.
DeleteFile
Delete a file.
RenameFile
Rename a file (same directory or not).
Trait Implementations§
impl Eq for FixEdit
impl StructuralPartialEq for FixEdit
Auto Trait Implementations§
impl Freeze for FixEdit
impl RefUnwindSafe for FixEdit
impl Send for FixEdit
impl Sync for FixEdit
impl Unpin for FixEdit
impl UnsafeUnpin for FixEdit
impl UnwindSafe for FixEdit
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more