How to find *real* usages of method?

Planned

When I have a class structure of this:

And I Ctrl+click or press Ctrl+Enter on `MyType.open()` to attempt to find it's usages, it lists all usages of `MyInterface.open()` instead, including usages of `MyOtherType.open()`. This is not what I want.

I've had this problem ever since I jumped from Eclispe and Netbeans to Intellij in 2016. IntellJ does about everything better but this has been bothering me since the start. It seems like a no-brainer that I don't want to find usages of `MyOtherType.open()` when I click on `MyType.open()`. I checked in the settings of the Find Usages and can't find anything related to it. The checkbox "Usages" is checked and the other three are unchecked. It doesn't make sense to limit to a scope either in this scenario, because setting up a scope for this would be at least as hard as filtering the usages by hand.

4 comments
Comment actions Permalink

Hello,

Please go to Find Usages settings and disable "Implementing methods" checkbox:

The result for me is the following:

If you experience the different behaviour, please share the code sample and the IDEA version that you use.

 

Thank you

0
Comment actions Permalink

Hi Olga,

I'm not talking about 'implementing methods' but 'method calls to this method'. As I said, the other three checkboxes are unchecked.

0
Comment actions Permalink

Mark, 

 

Thank you for clarification. Please use "Find usages with settings":

It will ask you whether you want to find the usages of the current method or the base method as well.

 

0
Comment actions Permalink

Thanks for pointing me to the action I didn't know about. It however opens an annoying "Find" tool panel instead of a popup under the cursor. At least it saves me a lot of time.

And I found an error on line 22 of my screenshot making the example pointless.

0

Please sign in to leave a comment.