find usages behavior...

I thought if you ask "highlight usages in a file" (ctrlshiftf7) of a method local variable, it used to highlight the usages of just that variable. Has this behavior changed or am I wrong in my basic assumption?

In 1151, when I do (ctrlshiftf7), I get all usage of a variable named "x" in ALL the methods of that class, not just the specific method where x local variable is defined.

It could very well be that I missed some thread where the behavior was changed. I am just checking...

4 comments

Are you sure you're not selecting the text of the variable rather than
just placing the caret in the variable? This semantically dubious
behaviour has been discussed here :
http://www.intellij.net/forums/thread.jsp?forum=22&thread=58351

N.

Vinay Moharil wrote:

I thought if you ask "highlight usages in a file" (ctrlshiftf7) of a method local variable, it used to highlight the usages of just that variable. Has this behavior changed or am I wrong in my basic assumption?

In 1151, when I do (ctrlshiftf7), I get all usage of a variable named "x" in ALL the methods of that class, not just the specific method where x local variable is defined.

It could very well be that I missed some thread where the behavior was changed. I am just checking...

0

Not long ago they mentioned that they changed some of the searches
to string-based ones for performance reasons. Not sure whether that
covers your problem and definitely don't like the change in behavior.
Did anyone notice similar "string-based" behavior with "Find usages"?
I think I saw it few times but not sure.

r.


Vinay Moharil wrote:

I thought if you ask "highlight usages in a file" (ctrlshiftf7) of a method
local variable, it used to highlight the usages of just that variable. Has
this behavior changed or am I wrong in my basic assumption?

In 1151, when I do (ctrlshiftf7), I get all usage of a variable named "x"
in ALL the methods of that class, not just the specific method where x local
variable is defined.

It could very well be that I missed some thread where the behavior was
changed. I am just checking...

0

I think what you said is right. Selecting the text and then ctrl + shift + f7 has a different behavior than putting the cursor in the variable name and then doing ctrl + shift + f7

Thanks for the tip though....

0

yes, Selecting the text and then ctrl + shift + f7 is "find all
instances of this text string" instead. The controversy is that a very
different function is bound to the same key via the same action, causing
confusions like yours.

Vinay Moharil wrote:

I think what you said is right. Selecting the text and then ctrl + shift + f7 has a different behavior than putting the cursor in the variable name and then doing ctrl + shift + f7

Thanks for the tip though....

0

Please sign in to leave a comment.