Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Refactor BuddyNew to Visual Studio Code? Get it now.
Refactor Buddy

Refactor Buddy

zjarlin

|
1 install
| (0) | Free
Smart extract and inline helpers that make VS Code refactor shortcuts behave more like IDE actions.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Refactor Buddy

Refactor Buddy adds practical refactor shortcuts for VS Code. It helps when a language server supports a refactor, but VS Code does not pick the right selection range or filters out the action because it is not marked as preferred.

Features

  • Smart Extract Variable
  • Smart Extract Function
  • Smart Inline
  • Automatic selection expansion when the editor has no selection
  • Action selection by querying the active language server
  • Works with TypeScript and JavaScript through TS Server
  • Works with Kotlin and Rust when their language servers expose matching refactor actions

Commands

Command Default keybinding used by the local setup
refactor-buddy.extractVariable Cmd+Alt+V / Cmd+Alt+C
refactor-buddy.extractFunction Cmd+Alt+M
refactor-buddy.inline Cmd+Alt+N

How It Works

Refactor Buddy does not implement a full compiler-grade refactoring engine. It:

  1. Uses VS Code selection ranges or a lightweight fallback to select the likely expression.
  2. Calls vscode.executeCodeActionProvider for the current language.
  3. Picks the best matching extract or inline action by code action kind and title.
  4. Applies the edit or command returned by the language server.

This keeps the extension small and lets Kotlin Server, rust-analyzer, and TS Server remain the source of truth.

Language Limits

If the active language server returns no matching action, Refactor Buddy cannot create that refactor by itself. Open Output: Refactor Buddy to see the exact actions returned for the current selection.

For Kotlin, this means the result depends on JetBrains Kotlin Server or another Kotlin language server. For Rust, it depends on rust-analyzer assists exposed through VS Code code actions.

Troubleshooting

After installing or updating the extension, run:

Developer: Reload Window

Then retry the command and inspect:

Output -> Refactor Buddy

If the log shows actions=<none>, the language server did not provide a matching refactor for that selection.

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