IntelliJ IDEA
 
Get IntelliJ IDEA
You are viewing the documentation for an earlier version of IntelliJ IDEA.

Extract Variable Dialog

Last modified: 10 August 2022

Refactor | Introduce Variable

Ctrl+Alt+V

The how to section: Extract/Introduce variable

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

  • 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.