[][src]Struct rslint_core::autofix::Fixer

pub struct Fixer {
    pub indels: Vec<Indel>,
    pub src: Arc<String>,
}

A simple interface for applying changes to source code

Fields

indels: Vec<Indel>src: Arc<String>

Implementations

impl Fixer[src]

pub fn new(src: Arc<String>) -> Fixer[src]

pub fn apply(&self) -> String[src]

Apply this fixer to its source code

pub fn replace(&mut self, from: impl Span, to: impl ToString) -> &mut Self[src]

Replace some area in the source code with a string

pub fn replace_with(&mut self, from: impl Span, to: impl Span) -> &mut Self[src]

Replace some area in the source code with another area in the source code

pub fn insert(&mut self, offset: usize, text: impl ToString) -> &mut Self[src]

pub fn wrap(&mut self, span: impl Span, wrapping: Wrapping) -> &mut Self[src]

pub fn wrap_with(
    &mut self,
    span: impl Span,
    left: impl ToString,
    right: impl ToString
) -> &mut Self
[src]

pub fn delete(&mut self, span: impl Span) -> &mut Self[src]

pub fn cancel_if_has_comments(
    &mut self,
    node: impl Borrow<SyntaxNode>
) -> &mut Self
[src]

pub fn unwrap(&mut self, node: impl Unwrappable) -> &mut Self[src]

pub fn insert_before(
    &mut self,
    span: impl Span,
    text: impl ToString
) -> &mut Self
[src]

pub fn insert_after(
    &mut self,
    span: impl Span,
    text: impl ToString
) -> &mut Self
[src]

pub fn eat_trailing_whitespace(&mut self, span: impl Span) -> &mut Self[src]

pub fn eat_leading_whitespace(&mut self, span: impl Span) -> &mut Self[src]

Trait Implementations

impl Clone for Fixer[src]

impl Debug for Fixer[src]

impl Eq for Fixer[src]

impl Hash for Fixer[src]

impl PartialEq<Fixer> for Fixer[src]

impl StructuralEq for Fixer[src]

impl StructuralPartialEq for Fixer[src]

Auto Trait Implementations

impl RefUnwindSafe for Fixer

impl Send for Fixer

impl Sync for Fixer

impl Unpin for Fixer

impl UnwindSafe for Fixer

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> Erasable for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.