

IntelliJ IDEA lists all the packages in your project. In the Project tool window, click Project and select Packages from the list. If you rename both module and directory at once, in the Rename dialog add the new name, check where to search for references and then click OK. In the Rename dialog that opens, add the new name and click OK. If you have a module with one content root, and it has the same name as your module, you can rename them both simultaneously.

In the popup that opens, select what you want to rename. In the Projects tool window right-click a directory or a module that you want to rename.įrom the context menu, select Refactor | Rename ( Shift+F6).
Rename file shortcut code#
IntelliJ IDEA renames the code element and updates its usages accordingly. IntelliJ IDEA will display in the gutter.Ĭlick the gutter icon or press Alt+Enter and apply a suggestion. In the editor start renaming a parameter, a method, or other code element. The refactoring changes are displayed on the Refactoring Preview tab in the Find tool window.

When you rename methods that are declared in interfaces, you can also review and rename their implementations as well. Preview potential changes before you refactor. Renaming classes or public methods could potentially impact a lot of files. Renaming local variables or private methods can be done easily inline since only the limited scope is affected. Use the Rename refactoring to change names of symbols, files, directories, packages, modules and all the references to them throughout code.
