Supun Wijerathne
Supun Wijerathne

Reputation: 12948

Problem with intellij idea rename variable?

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.

enter image description here

Do some one know what the exact problem here? And a convenient solution?

Thank You.

Upvotes: 0

Views: 573

Answers (1)

CrazyCoder
CrazyCoder

Reputation: 402015

Disable the option to search in comments and strings in the Rename dialog:

search

The option is available when you press Shift+F6 twice.

Upvotes: 1

Related Questions