Closed
Description
Suppose I had a statement like so:
let result = some_complicated_computation(arg1, arg2, arg3, "annoyingly long literal of text");
I'd like to be able to put my cursor inside the str literal (or a numeric literal) and have the option to run a refactoring code action to extract the literal into a variable. The result of running this on the previous example would be:
let var_name = "annoyingly long literal of text";
let result = some_complicated_computation(arg1, arg2, arg3, var_name);
The refactoring can improve readability or set the code up for further refactorings (like moving the variable to a parameter/field).
Currently when I try to do this (in VSCode), I get no such option.