Rename Refactoring

Use the Refactor > Rename command to rename variables, functions, classes, methods, fields or typedefs.

In an Editor window, select an item and run Refactor > Rename... from the context menu.

Example of inline renaming.

All uses of the name are highlighted, and updated in real time as you type. If you want to view the preview, or change any options, simply click on the triangle, or press the keyboard shortcut again. Otherwise, the options are the same as the last time a rename refactoring was done.

When you hit Enter, all the item's declarations, definitions and references will be changed to use the new name. The standard Undo command can be used to revert the changes, if necessary.

The options can be set using a dialog box, where you can specify the new name, and set various options affecting how hard to look for uses of the name that should be updated. From there you can also view the Preview of the changes that will be made by the refactoring.

Rename dialog box

Items to be renamed can also be selected from the Project Explorer window, although inline renaming is not available in this case, so the dialog box comes up immediately.

Project Explorer context menu Refactor > Rename command

Related reference
Refactor Menu actions

IBM Copyright Statement