Live rename/refactoring in current file only

Answered

Is shift+F6 (wih its modal window and searching through all files in the project) the only way to rename something in the file? I mean, I would like to rename all instances of the same variable in the current file only, without modal window and its extensive searching. I could swear, I saw in RubyMine something like LIVE renaming in Netbeans, but I could not remember how I had did it before.

0
4 comments
Avatar
Permanently deleted user

Hello Jaroslaw,

Is shift+F6 (wih its modal window and searching through all files in the project) the only way to rename something in the file? I mean, I would like to rename all instances of the same variable in the current file only, without modal window and its extensive searching. I could swear, I saw in RubyMine something like LIVE renaming in Netbeans, but I could not remember how I had did it before.

Inplace quick rename is avaialble only local variables/parameters, because in this case we can 100% guarantee the accuracy of refactoring.
If you want to rename all occurences in file you can run action Show Usages (Ctrl+Alt+F7 on Linux). It will highlight all the usages in opened file and you will be able to navigate through them using right editor border.
usages.png

Regards,
Oleg

0

It would be nice to have an "exclude non selected" option in the Refactoring Preview, which, when applied to a selected tree, excludes all other trees automatically.

 

Actual options when rightclicking a tree or subtree in the Refactoriing Preview:

0

@Alexlampe, is it in PyCharm? What kind of refactoring is that? In case of rename refactoring we have a corresponding request: https://youtrack.jetbrains.com/issue/IDEA-124496

0

Oh sorry. Haven't seen that this thread is about RubyMine. Thanks for the link. 

0

Please sign in to leave a comment.