Use snippets for extract refactorings #50166
Labels
Domain: Refactorings
e.g. extract to constant or function, rename symbol
Experience Enhancement
Noncontroversial enhancements
Help Wanted
You can do this
Suggestion
An idea for TypeScript
Milestone
Feature request
馃攷 Search Terms
Problem
Today our extract refactorings run in two stages:
newFunction
)This has a few problems:
Proposal
VS Code now supports including snippets in the workspace edits that extensions provide on refactorings. My proposal is that TS Server uses snippet syntax in the edit returned for extract method/constant so that users immediately start renaming the new function/constant instead of using the two phase flow we have to day
Example
For the TS:
If I select
1 + 2
and select theextract to function in global scope
refactoring, I should get the following snippet (note that I'm using VS Code's snippet annotation here):Typing would update both places where newFunction is used:
The text was updated successfully, but these errors were encountered: