Reputation: 12948
When I try to rename a variable using Shift + F6 or simply Refactor => Rename, sometimes intellij renames not only the one I want to, but also some other variables (in other files) with the same name and all their references which are completely irrelevant.
When I further studied that behavior I got to know that it happens only for public variables. Refer below screenshot. I tried to rename the squared variable (keywords). There are lots of totally irrelevant code lines are suggested below to rename accordingly.
Do some one know what the exact problem here? And a convenient solution?
Thank You.
Upvotes: 0
Views: 573
Reputation: 402015
Disable the option to search in comments and strings in the Rename dialog:
The option is available when you press Shift+F6 twice.
Upvotes: 1