Any way to disable or set default refactor preview behaviour?

Answered

I'm bothered by the constant nagging of if I want to refactor string literals and comments, when doing field renaming in Java classes. Is there any way I can set up IDEA to never bother with string literals, comments and non-code files when doing refactor  > rename?

0
9 comments

When you apply Refactor / Rename action, do you see a dialog, or new name editing is performed in-place, right in the editor?

If no dialog is shown, you can temporarily make it shown. In Settings dialog (it has a search possibility) search for "Enable in-place mode" and set it off.

Then, on next refactoring you'll get the dialog with options "Search in comments", "Search for text". Switch them off.

Then, if you like, you can switch back to in-place mode. Those options should be remembered.

Looks a bit tricky, but I've not found more direct way in the latest IDEA. Will ask developers, maybe I've missed something.

Regards,
Alexander.

0

Thanks Alexander,
everything correct but you don't need to temp disabling inplace refactorings, second keystroke (Shift F6/Shift F6) would show dialog with settings which are remembered between restarts

Anna

0

Bullshit. There is only one !!! Option "Search in comments and strings" which is off !!! And still to rename this fucking file you have to wait for 3-4 minutes !! What kind of fuck is that ??

1

Agree that renaming files takes obnoxiously long even if you turn off everything.

0

Hello,

 

Please report new issue on YouTrack attaching idea.log ("Help | Show Log in...") after restarting IDE and reproducing the issue: http://youtrack.jetbrains.com/issues/IDEA.

0

I think it should be mentioned, that sometimes it is ok to SEARCH for replacement in strings and i want to check suggestions, but almost every time I want them to be EXCLUDED from replacement by default. This would be nice option and good default behavior.

0

Default settings for renaming a Java class in IntelliJ IDEA 2020.3.1 are as follows:

The option to search in comments and strings is disabled by default. This also applies to renaming directories, variables, etc.

0

I mean that i am kinda okay with search and suggestions — i read them, but i am not okay with default that INCLUDES such suggestions in refactoring, in my experience most of them shouldnt be included. 

0

L0kix2

Would it be possible for you to provide a code sample and describe in detail at which point of the 'Rename' refactoring process you would like IDEA to behave differently?

0

Please sign in to leave a comment.