Refactor code
Refactoring is the process of modifying source code in order to make it easier to maintain and extend, but without changing its behavior. RubyMine supports various refactoring operations for different programming languages. This topic mostly covers refactorings available for Ruby.
Invoke refactoring
Select an item to refactor. You can select a file/folder in the Project tool window or expression/symbol in the editor.
Press Ctrl+Alt+Shift+T to open a list of refactorings that can be selected.
Alternatively, you can use a keyboard shortcut for a specific refactoring.
If you need to undo your refactoring, press Ctrl+Z.
Preview refactoring changes
For some refactorings, RubyMine lets you preview changes before applying them.
To see potential changes (the list of usages where the refactoring will be performed), click Preview in the Refactoring Preview dialog.
Check the changes that are going to be made in the Find tool window. You can exclude Delete or remove Ctrl+X changes that you consider unnecessary.
Click Do Refactor to proceed with the changes.
Configure refactoring settings
In the Settings dialog (Ctrl+Alt+S), select .
On the Code Editing page, in the Refactorings section, adjust the refactoring options and click OK.
Refactorings supported in RubyMine
Shift+F6 | ||
F6 F5 | ||
Ctrl+Alt+V | ||
Ctrl+Alt+C | ||
Ctrl+Alt+F | ||
Ctrl+Alt+P | ||
Ctrl+Alt+M | ||
Ctrl+Alt+N | ||
Alt+Delete | ||