pub struct RenameProvider { /* private fields */ }Expand description
Rename provider
Implementations§
Source§impl RenameProvider
impl RenameProvider
Sourcepub fn new(ast: &Node, source: String) -> RenameProvider
pub fn new(ast: &Node, source: String) -> RenameProvider
Create a new rename provider
Sourcepub fn prepare_rename(&self, position: usize) -> Option<(ByteSpan, String)>
pub fn prepare_rename(&self, position: usize) -> Option<(ByteSpan, String)>
Prepare rename at a position (check if rename is possible)
Sourcepub fn rename(
&self,
position: usize,
new_name: &str,
options: &RenameOptions,
) -> RenameResult
pub fn rename( &self, position: usize, new_name: &str, options: &RenameOptions, ) -> RenameResult
Perform rename operation (renames all occurrences regardless of scope)
Sourcepub fn scoped_rename(
&self,
position: usize,
new_name: &str,
options: &RenameOptions,
) -> RenameResult
pub fn scoped_rename( &self, position: usize, new_name: &str, options: &RenameOptions, ) -> RenameResult
Perform scope-aware rename operation.
Unlike rename(), this respects Perl lexical scoping: only renames the
declaration and references within the same scope subtree. A $foo in an
inner scope that shadows the outer $foo is treated as a separate variable.
Auto Trait Implementations§
impl Freeze for RenameProvider
impl RefUnwindSafe for RenameProvider
impl Send for RenameProvider
impl Sync for RenameProvider
impl Unpin for RenameProvider
impl UnsafeUnpin for RenameProvider
impl UnwindSafe for RenameProvider
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