Any way to set options in rename refactoring?

Answered

our entire team has stopped using intellij's "rename" capability - because it's just too dangerous - it just renames all sorts of random stuff - we've lost massive amount of time because someone tried a refactor and stuff got renamed that shouldn't.... but it's also annoying, with the box coming up asking if you if you also want to rename this.

Bottom line - if there's even a 0.000001% chance that you might not also want to rename something else - then I want to just fix the answer to no.   If I rename a value - I only want to rename anything that would cause a compile error - and the corresponding javadoc.   NO I don't want to rename comments, or related symbols, or overloards, or just the same symbol name in completely different classes.     And I _certainly_ don't want to get a dialog box coming up asking me about things.. it's actually quicker and easier to rename by hand and then hit build and follow through the compile errors.

What I don't understand - rename is a common refactoring - basically every other IDE does it - and no one screws it up like this.

Is there any way to set intellij to sort of just do a "simple" rename - and just assume I answered "no" to anything that's even slightly in doubt?

0
6 comments

You can disable searching in comments and strings: https://stackoverflow.com/a/20871481/104891.

If you still get invalid results after refactoring and compilation breaks, please report a bug at https://youtrack.jetbrains.com/issues/IDEA with the steps to reproduce.

0

awesome!    Thank you!   will try that immediately.   Will that get rid of the annoying "do you want to go ahead" dialog?

0

so - you seem to have to turn off all sorts of things for all sorts of different fields - so for variables and methods separately you need to turn off search in comments and strings, search for text occurrences - but for classes you need to turn off comments and strings, rename tests, rename variables, text occurrences...

so what sorts of objects are available?   I've found variables, methods and classes - but what I'm terrified about is that I'll try a rename on something, and won't realize that that's a new sort of thing that I haven't turned off and then I'm back into "randomly corrupt your code" territory

0

You will get a confirmation for dangerous refactorings.

0

yep -anyway bottom line - you've solved my problem - I'm very happy - thanks!

0

Please sign in to leave a comment.