ReSharper Web Help

Available refactorings:

  • Rename
  • Introduce variable

Refactoring commands are available:

  • in ReSharper | Refactor menu
  • on the context menu of the editor
  • on the Refactor This context menu


ReSharper distinguishes functions and variables. According to the type of the property that should be refactored, the process of renaming goes on in two possible ways.

To rename a function, written by you, defined in js module or a library one, follow the procedure steps in the Refactorings: Rename topic.

When you rename a variable, refactoring is performed without dialogs.

To apply 'rename' refactoring
  1. Position the caret at the name of a variable.
  2. Do one of the following:
    • On the main menu, choose ReSharper | Refactor | Rename.
    • Press F2.
    • Press Ctrl+Shift+R and select Rename in/on the Refactor This context menu.
  3. The edited variable is placed in a red rectangle, all others in black dotted rectangles.
  4. Type a new name and press Enter to apply the changes.

Consider the following example:

Introduce Variable

The Introduce variable refactoring allows to create a new local variable based on a selected expression. Before the refactoring is applied you are prompted to decide whether to replace all occurrences of the expression or the selected one.

The algorithm of introducing variable is almost the same as described in the Refactorings: Introduce variable topic.

Consider the example below:

See Also