Introduce Variable
Go Up to Refactor Menu
Refactor > Introduce Variable
Note: This feature comes through Visual Assist.
The Introduce Variable feature defines a temporary variable in the innermost scope of the selection. It initializes it with the replaces code, if any, and replaces one or multiple occurrences of the expression with the temporary variable.
To perform this feature, follow the next steps:
- Set the cursor in the symbol.
- Go to the Refactor option of the main menu.
- Select Introduce Variable.
- When the Introduce Variable window opens, enter the variable signature in the text field.
- Click OK to introduce the variable or Cancel to exit the feature.