Refactoring actions

There are many different refactoring actions available in IntelliJ IDEA. Let's cover the important ones first: Rename, Copy, Move, and Safe Delete.


This is probably the most commonly used refactoring. The target for the rename action can be any symbol in the source code: class, method, field, method parameter, or local variable.

To rename, just pick the target and press Shift + F6. This action will start the in-place prompt, as shown in the following screenshot:


If you use the Shift + F6 shortcut twice, the Rename dialog box will offer additional options such as searching within comments and text strings, as shown here:

IntelliJ ...

Get IntelliJ IDEA Essentials now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.