pub struct SyntaxEditor { /* private fields */ }
Implementations§
source§impl SyntaxEditor
impl SyntaxEditor
sourcepub fn add_generic_param(&mut self, function: &Fn, new_param: GenericParam)
pub fn add_generic_param(&mut self, function: &Fn, new_param: GenericParam)
Adds a new generic param to the function using SyntaxEditor
source§impl SyntaxEditor
impl SyntaxEditor
sourcepub fn new(root: SyntaxNode) -> Self
pub fn new(root: SyntaxNode) -> Self
Creates a syntax editor to start editing from root
pub fn add_annotation( &mut self, element: impl Element, annotation: SyntaxAnnotation, )
pub fn merge(&mut self, other: SyntaxEditor)
pub fn insert(&mut self, position: Position, element: impl Element)
pub fn insert_all(&mut self, position: Position, elements: Vec<SyntaxElement>)
pub fn delete(&mut self, element: impl Element)
pub fn replace(&mut self, old: impl Element, new: impl Element)
pub fn replace_with_many(&mut self, old: impl Element, new: Vec<SyntaxElement>)
pub fn replace_all( &mut self, range: RangeInclusive<SyntaxElement>, new: Vec<SyntaxElement>, )
pub fn finish(self) -> SyntaxEdit
pub fn add_mappings(&mut self, other: SyntaxMapping)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SyntaxEditor
impl !RefUnwindSafe for SyntaxEditor
impl !Send for SyntaxEditor
impl !Sync for SyntaxEditor
impl Unpin for SyntaxEditor
impl !UnwindSafe for SyntaxEditor
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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