-
Notifications
You must be signed in to change notification settings - Fork 6
Smart Rename Preview #5
Copy link
Copy link
Open
Labels
P2-mediumImportant but not urgent. Can be scheduled after high-priority tasks are completed.Important but not urgent. Can be scheduled after high-priority tasks are completed.documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or requestgood first issueBeginner-friendly tasks with clear scope and minimal complexity, ideal for new contributors.Beginner-friendly tasks with clear scope and minimal complexity, ideal for new contributors.intermediateModerately complex tasks requiring familiarity with the codebase and relevant APIs.Moderately complex tasks requiring familiarity with the codebase and relevant APIs.
Description
Metadata
Metadata
Assignees
Labels
P2-mediumImportant but not urgent. Can be scheduled after high-priority tasks are completed.Important but not urgent. Can be scheduled after high-priority tasks are completed.documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or requestgood first issueBeginner-friendly tasks with clear scope and minimal complexity, ideal for new contributors.Beginner-friendly tasks with clear scope and minimal complexity, ideal for new contributors.intermediateModerately complex tasks requiring familiarity with the codebase and relevant APIs.Moderately complex tasks requiring familiarity with the codebase and relevant APIs.
VS Code's default rename applies changes immediately or shows a minimal preview. Developers often miss cross-file impacts, dynamic references, or naming collisions, leading to broken builds or subtle runtime bugs. A dedicated, risk-aware preview workflow would surface potential issues before commitment.
Objective
Build a rename interception & preview system that collects all proposed rename edits, visualizes them in a structured UI, highlights potential conflicts/risky patterns, and requires explicit user confirmation before applying.
📋 Scope & Implementation Details
1. Rename Interception & Collection
safeRename.start(optionally overrideeditor.action.rename)edit.entries()to build a preview model grouped by file2. Preview UI
vscode.window.createTreeViewwith a customTreeDataProvidervscode.commands.executeCommand('vscode.diff', ...))3. Risk & Conflict Detection
obj["old"])4. Confirm/Cancel Workflow
"Apply All"→vscode.workspace.applyEdit(collectedEdit)"Review Selected"→ open diff"Cancel"→ discard edit, restore cursorAcceptance Criteria
Technical Notes
vscode.executeDocumentRenameProviderand enhance the output.vscode.commands.executeCommand('vscode.executeDocumentSymbolProvider')+ name overlap checkvscode.WorkspaceEditfor atomic application; preserves undo/redo historynullor times out