Extract Variable dialog
Generally, this dialog is used to extract new variables. Depending on the language, there may be additional options.
In Java, you can declare the new variable
final.To make this dialog accessible for Java, you have to disable in-place refactoring in the editor settings.
In JavaScript, you can select to extract a (global) variable or a constant. For JavaScript 1.7, JavaScript 1.8.5, ES5, and ES6, there is also an option of extracting a local variable.
Item | Description | Language |
|---|---|---|
Variable of type | The type of the new variable. | Java |
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 | Java |
Declare var type | Select this option to declare the introduced variable with | Java |
Choose how to extract the variable:
| JavaScript |