Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Scoped RefactorNew to Visual Studio Code? Get it now.
Scoped Refactor

Scoped Refactor

Fabian Perez

|
2 installs
| (0) | Free
Run targeted workspace refactors with add-before, remove-all, and edit-all actions, plus path scoping and comment-safe matching.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Scoped Refactor

Scoped Refactor is a VS Code extension for fast, targeted text refactors across your workspace.

Language Support

Scoped Refactor works on text files across different languages, including:

  • Python (.py)
  • JavaScript (.js)
  • TypeScript (.ts)
  • React / JSX (.jsx)
  • React / TSX (.tsx)
  • Java (.java)
  • And other source files in your workspace

It is language-agnostic (text-based), so it can be used broadly in mixed codebases.

What It Does

  • Supports 3 actions:
    • Add before to...
    • Remove all...
    • Edit all...
  • Lets you define one or more targets (with + / - controls).
  • Lets you define path rules (with + / - controls):
    • Ignore path
    • Only modify this path
  • Supports path patterns:
    • Folder pattern: src/generated/*
    • Exact file path: src/game/Player.java
    • File name only: Player.java
  • Includes Validate results to preview how many matches/files would be affected.
  • Shows results in a bottom result box inside the extension view.
  • Skips replacements inside comments (//, /* ... */, and # line comments).
  • Avoids duplicate prefix insertion when using Add before to....

How It Works

  1. Open Scoped Refactor from the Activity Bar.
  2. Choose an action (Add before, Remove all, or Edit all).
  3. Provide:
    • Action text (required for Add before and Edit all)
    • One or more targets
    • Optional path rules
  4. Click Validate results to preview.
  5. Click Confirm to apply changes.

Best Use Cases

  • Refactoring many repeated identifiers quickly.
  • Applying controlled replacements in selected files/folders.
  • Bulk cleanup or migration tasks while keeping comments untouched.

Examples

  • Java: Add instance. before target life across classes.
  • TypeScript/React: Edit all oldApi to newApi in selected folders.
  • Python: Remove all uses of a deprecated token outside comments.

License

This project is licensed under the MIT License - see the LICENSE file for details.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft