Diana #9939 Find Usages (Ctrl-Alt-F7) fails

I'm trying to find global usages of classes and methods, using Ctrl-Alt-F7 when the cursor is on the method or class name, and it is telling me "No usages found in Project Files" every time, for everything - even for methods that are clearly used within the same class...

This is really bad news when I'm deep into debugging an application.

The log shows nothing. However, if I use the context menu (right-click) or Alt-F7 'Find Usages' and search the whole project, the search works OK, and I then the Ctrl-Alt-F7 global 'Find Usages' starts working again.

Needless to say, this is extremely disconcerting.

10 comments
Comment actions Permalink

Make sure you're not having the context set to "Test source".

See also http://jetbrains.net/tracker/issue/IDEADEV-39495

0
Comment actions Permalink

Are you asking about Java code? I see many gaps in the Find Usages functionality for Scala.


Randall Schulz

0
Comment actions Permalink

Interestingly, I've noticed the exact same thing today (also with ALT+F7)
but I'm running Maia EAP build #10781. I'm definitely searching the whole
project scope. I've tried clearing the caches and restarting a couple of
times but the problem still happens consistently. For example, I have a method
that is defined in module A, and called once in module A and once in module
B. Find usages only ever finds the one usage in module A, it doesn't see
the usage in module B even though Module B is correctly set up to depend
on Module A (note that I don't know if the module setup is related to the
problem or not, I'm just posting one particular observation that seems like
it may be relevant).

Another thing I've noticed is that Find in Path (CTRLSHIFTF) and searching
on the method name fails the same way (can't find the text in module B),
but ONLY if "Whole words only" is selected. This to me implies there is an
underlying indexing problem, since disabling "Whole words only" bypasses
the index and hence finds the text OK.

(Another problem with "Find in Path" is that it seems to keep changing the
scope back to "Directory" between invocations. VERY annoying!)

Not being able to trust Find Usages and Find in Path is indeed very unsettling.
It didn't help that I discovered this when working through a problem with
an Eclipse user looking over my shoulder... :(

Chris


DL> I'm trying to find global usages of classes and methods, using
DL> Ctrl-Alt-F7 when the cursor is on the method or class name, and it
DL> is telling me "No usages found in Project Files" every time, for
DL> everything - even for methods that are clearly used within the same
DL> class...
DL>
DL> This is really bad news when I'm deep into debugging an application.
DL>
DL> The log shows nothing. However, if I use the context menu
DL> (right-click) or Alt-F7 'Find Usages' and search the whole project,
DL> the search works OK, and I then the Ctrl-Alt-F7 global 'Find Usages'
DL> starts working again.
DL>
DL> Needless to say, this is extremely disconcerting.


0
Comment actions Permalink

Yes, Java code.

0
Comment actions Permalink

TarasT wrote:

Make sure you're not having the context set to "Test source".

See also http://jetbrains.net/tracker/issue/IDEADEV-39495


Not quite sure what you mean by 'having the context set to "Test source"' - these were not test source files, they were source files for an active application that I was debugging.

I don't see quite how that tracker is relevant - it just complains that the Quick Find Usages result display settings are picked up from the Find Usages settings, not that it returns no results at all...

0
Comment actions Permalink

I have the same problem in IDEA 9 Beta

0
Comment actions Permalink

Well, if you look at the link in the issue Taras is refering too, you can see that I mentioned this more than a year ago in the forums. I wouldn't expect this to be fixed anytime soon.

0
Comment actions Permalink

Erik,

Note that in Maia you can edit the search scope from the popup (right-most button, Ctrl-Alt-Shift-F7).

Personally, I'd prefer a minimal UI in the window tool bar: similar to selecting read/write/both access, I could select production/test/both usages.

In order to make room for that, I'd say the the "Show import statements" option could be killed.
I doubt anyone doing a quick search is interested in import statements.

In addition, quick find usages could always "merge usage from same line". If you want such details, do a regular search.

Now the window toolbar UI would become:
[read access][write access]  [production][test]
By default, all would be enabled.

That would, to me, make more sense as a "quick show usages" user interface. Critique welcome

Taras

0
Comment actions Permalink

Here's a mock-up of how "Quick Find Usages" looks like in IDEA 10.0, in my ideal world.

quick-show-usages.bmp

0
Comment actions Permalink

I was using 90.94 and it used to work until today (or maybe it partially worked and didn't notice which is even worse). Upgrading to 9 beta doesn't solve it for me either. I should be probably evaluating 8 instead.  

0

Please sign in to leave a comment.