Rename a File and Its References

Change your mind on a file name and the IDE makes all the changes for you.

Rename files with peace of mind.

Changed your mind about what you named a file but terrified of all the places it might be used? You might not remember, but the IDE does. Let the Rename Refactoring do the work, safely and quickly.

In Depth

You made a file. You tried to choose the right filename. You then used it all over your project.

Now you've changed your mind.

It's sitting there, annoying you, but you can't be bothered to find all the places that use it. Search and replace might find a bunch of false positives. You'd really like something that understood symbols, and just in imports.

Select the file and use Refactor | Rename (Shift-Ctrl-Alt-T, 1 Win/Linux, Ctrl-T, 1 macOS) to change the name of the file and occurrences. This will also adjust VCS. Best of all, if you change your mind, Undo puts it all back as one editor transaction.

Full Video

Copyright © 2000–2020 JetBrains s.r.o.