Rename refactorings
Shortcut: ShiftF6
Main menu: Refactor | Rename
Context menu: Rename
General refactoring settings: Settings | Editor | Code Editing
Use the Rename refactoring to change names of symbols, files, directories, Rails application components, Rails named scopes, Rails fixtures, and so on. RubyMine automatically changes all the references to renamed items throughout code.
Renaming local variables or private methods can be done easily inline since only the limited scope is affected. Renaming classes or public methods could potentially impact a lot of files. In this case, we suggest that you preview potential changes before you refactor.
The procedure below demonstrates how to rename a class method.
Place a caret at the method name:
GifPress ShiftF6 or select Refactor | Rename... from the main menu.
Specify a new method name in the invoked dialog and click Refactor:
In the Refactoring Preview window, inspect code changes to be made and click Do Refactor:
Before | After |
---|---|
|
|
Thanks for your feedback!