IntelliJ IDEA 14.0.0 Web Help

Extract Variable Dialog

Refactor | Extract VariableCtrl+Alt+V

Generally, this dialog is used to extract new variables. Depending on the language, there may be additional options, for example:

  • In JavaScript, you can select to extract a (global) variable or a constant. For JavaScript 1.7 or a later version, there is also an option of extracting a local variable.
  • In ActionScript, you can choose to extract a constant rather than a variable, and specify the variable type.
Item Description Language
10.5+Type Select the type of the new variable. ActionScript
Name Specify the name for the new variable. All
Replace all occurrences Select this option to replace all the occurrences of the selected expression (if more than one occurrence of the selected expression is found). All
Declare final Select this option to declare the new variable final. Java
Var kind Choose to extract a (global) variable, a constant, or a local variable:
  • extract var - select this option to extract a global variable.
  • extract constant - select this option to extract a constant.
  • extract local variable - select this option to extract a local variable.

    The extract local variable option is available only for JavaScript 1.7 or a later version.

JavaScript
Make constant Select this option to extract a constant rather than a variable. ActionScript

See Also

Last modified: 12 November 2014
comments powered by Disqus