Right-click the package you want to rename and from the context menu, select Refactor | Rename ( Shift+F6). 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, type the new name, specify additional options and the scope of the refactoring, and click Refactor. 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 Project tool window right-click a directory or a module that you want to rename.įrom the context menu, select Refactor | Rename ( Shift+F6). 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |