Show Usages can bite you in the @#$

I like this Search->Show Usages and have been using alot, but today I got into trouble using due to the fact that it uses the Scope setting from the last Search->Find Usages.

At some point I had done a Find Usages with a current file as the scope. The sometime later I used Show Usages on some methods and the little tooltip said "No usages". I said hm.. ok.. let me delete these methods since no one is using these methods. Little did I realize that Show Usages was still using the current file scope.

Needless to say, sometime later when got around to compiling, I found out that oops, those methods are being used!! and so I had to put em back.

Some suggestions:
1. If the scope is anything other than "Project files", then the scope should be added to the "No usages" and the "It's the only usage".tooltips so you might see something like this "No usages in current file", "No usages in module 'x'", "No usages in 'custom-scope-xyz'"

Note: When there is more than 1 usage, then the popup window is displayed and it does show the scope in the title bar, so that is good. The problem is only with the "No usages" and "It's the only usage".

2. Scope: current file should really mean the current file, not the file you last did Find Usages on. That is really confusing. Try doing a FInd Usages on a method in file X.java, and then goto a file Y.java which also uses that method and invoke Show Usages. It will says "No usages" even though your caret is sitting smack dab on a usage of the method

3. For next release, I think you need to rework this whole concept how Show Usages reuses Find Usages last state. It's reallly not a good idea IMO.

1 comment
Comment actions Permalink

definitely +1, happened to me too, showing the scope would help a lot!

regards,

Messi

0

Please sign in to leave a comment.