WebStorm 2023.2 Help

Rename dialogs

Refactor | Rename

Shift+F6

The Rename dialogs let you perform the Rename refactoring for various entities such as classes, fields, methods, parameters, etc. You can select where the changes to occurrences of the entity name are required and where not.

Item

Description

Rename <symbol name> and its usages to

In this field, specify a new name for the symbol.

Search in JavaScript files

Select this checkbox to rename the usages of the function or the class in compiled JavaScript code.

Search for dynamic references

Select this checkbox to rename the dynamic usages of the symbol, for example, those of the type any.

Including dynamic usages in the refactoring may cause erroneous renaming as shown in the example below.

interface myInt { target: string } function onClick(e: any) { console.log(e.target); }
interface myInt { myTarget: string } function onClick(e: any) { console.log(e.myTarget); }

Search for references

This checkbox is only available for Rename File and Rename Directory refactoring.

  • Clear the checkbox to have WebStorm rename only the file or folder itself without attempting to find its usages and update them accordingly.

  • Select this checkbox to have WebStorm search for usages of the file/folder name and apply the refactoring to them.

Search in comments and strings

Select this checkbox to have the changes applied to comments and strings.

Search for text occurrences

Select this checkbox to have the changes applied to the documentation, HTML, and other files included in the project.

Last modified: 23 August 2023