pub struct WorkspaceRename { /* private fields */ }Expand description
Workspace rename engine
Provides comprehensive symbol renaming across entire workspace with atomic operations, backup support, and progress reporting.
Implementations§
Source§impl WorkspaceRename
impl WorkspaceRename
Sourcepub fn new(index: WorkspaceIndex, config: WorkspaceRenameConfig) -> Self
pub fn new(index: WorkspaceIndex, config: WorkspaceRenameConfig) -> Self
Sourcepub fn index(&self) -> &WorkspaceIndex
pub fn index(&self) -> &WorkspaceIndex
Get a reference to the workspace index
Sourcepub fn rename_symbol(
&self,
old_name: &str,
new_name: &str,
file_path: &Path,
_position: (usize, usize),
) -> Result<WorkspaceRenameResult, WorkspaceRenameError>
pub fn rename_symbol( &self, old_name: &str, new_name: &str, file_path: &Path, _position: (usize, usize), ) -> Result<WorkspaceRenameResult, WorkspaceRenameError>
Rename a symbol across the workspace
§Arguments
old_name- Current symbol namenew_name- New symbol namefile_path- File containing the symbolposition- Position of the symbol (line, column)
§Returns
Ok(WorkspaceRenameResult)- Rename result with edits and statisticsErr(WorkspaceRenameError)- Error during rename operation
§Errors
SymbolNotFound- Symbol not found in workspaceNameConflict- New name conflicts with existing symbolTimeout- Operation exceeded configured timeoutFileSystemError- File I/O error
Sourcepub fn rename_symbol_with_progress(
&self,
old_name: &str,
new_name: &str,
file_path: &Path,
_position: (usize, usize),
progress_tx: Sender<Progress>,
) -> Result<WorkspaceRenameResult, WorkspaceRenameError>
pub fn rename_symbol_with_progress( &self, old_name: &str, new_name: &str, file_path: &Path, _position: (usize, usize), progress_tx: Sender<Progress>, ) -> Result<WorkspaceRenameResult, WorkspaceRenameError>
Rename a symbol with progress reporting
§Arguments
old_name- Current symbol namenew_name- New symbol namefile_path- File containing the symbolposition- Position of the symbol (line, column)progress_tx- Channel for progress events
§Returns
Ok(WorkspaceRenameResult)- Rename result with edits and statisticsErr(WorkspaceRenameError)- Error during rename operation
Sourcepub fn apply_edits(
&self,
result: &WorkspaceRenameResult,
) -> Result<(), WorkspaceRenameError>
pub fn apply_edits( &self, result: &WorkspaceRenameResult, ) -> Result<(), WorkspaceRenameError>
Apply file edits atomically with rollback support
§AC:AC3 - Atomic multi-file changes
Sourcepub fn update_index_after_rename(
&self,
old_name: &str,
new_name: &str,
file_edits: &[FileEdit],
) -> Result<(), WorkspaceRenameError>
pub fn update_index_after_rename( &self, old_name: &str, new_name: &str, file_edits: &[FileEdit], ) -> Result<(), WorkspaceRenameError>
Update the workspace index after a rename operation
§AC:AC8 - Dual indexing update
Auto Trait Implementations§
impl Freeze for WorkspaceRename
impl !RefUnwindSafe for WorkspaceRename
impl Send for WorkspaceRename
impl Sync for WorkspaceRename
impl Unpin for WorkspaceRename
impl UnsafeUnpin for WorkspaceRename
impl !UnwindSafe for WorkspaceRename
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