vscode-javascript-booster icon indicating copy to clipboard operation
vscode-javascript-booster copied to clipboard

Feature Request: Introduce Variable

Open Oripi opened this issue 3 years ago • 0 comments
trafficstars

Hi, There's a really useful feature that i miss from intellij/webstorm and that's the introduce variable: https://www.jetbrains.com/help/idea/extract-variable.html image

it allows you to put the caret over any part of an expression (usually a method that returns a value but is not assigned to a variable) and when selecting the refactor command it assigns it to a variable. example:

// before refactor:
function doSomething() {
  return 'hello';
}

something();

// after putting caret at the end/middle/inside parentheses of method and selecting refactor command (the variable name is selected to easily give a new name):
const variableName = something();

would love to see this feature in this great extension :)

Oripi avatar Sep 15 '22 09:09 Oripi