Rename Symbol

Change a variable name, class name, or other symbol, across the project.

You wrote a function which you use all over the place in a project. Or a class. The name no longer matches its purpose. But the change is too much of a hassle.

The IDE knows where it is used. Even better, it knows the difference between usage in your project vs. finding it in a dependency, and best of all, usage as a symbol vs. just some letters in a string.

What if the same symbol name is used in two Python modules? Yep, PyCharm can tell the difference and only rename to the appropriate the symbol from that module.

Same for method names. Have the same method in two classes? Refactor Rename ⇧F6 (macOS) / Shift+F6 (Windows/Linux) will look in your project for the correct usage and rename it.

Simply put your cursor on a symbol and use Refactor | Rename ⌃T (macOS) / Shift+Ctrl+Alt+T (Windows/Linux) and then '1' Provide the new name, preview the places it found, and select Do Refactor.

Change your mind? Refactoring is done as a single editor transaction, meaning Undo reverts all the places that were renamed.


Related Resources

Navigation Bar - All the power!
Navigation Bar - All the power!
The Navigation Bar can do much more than you think!
Clean Up Messy Imports With Optimize Imports
Clean Up Messy Imports With Optimize Imports
Quickly remove any unused imports and more.
Find in Path with the Navigation Bar
Find in Path with the Navigation Bar
Use the Navigation bar and Find in File together and be faster than all of your team members.