Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find Method usages only for specified class in Intelij-Idea

I am using IntelliJ IDEA and I have problem with method usage finding.

Suppose I have interface Worker.

public interface Worker {
    
    void startWork();
    void endWork();
}

And I have two implementations.

public class Develper implements Worker {
    @Override
    public void startWork() {
        System.out.println("Developer Start Working");
    }

    @Override
    public void endWork() {

    }
}

public class Qa implements Worker {
    @Override
    public void startWork() {
        System.out.println("QA start Work");
    }

    @Override
    public void endWork() {

    }
}

I open the Developer class and trying to find usages of startWork(). I want only to view usage of the Developer.startWork() implemented method.

But when I find usages it shows both Developer and Qa.startWork() method usages. How can I avoid Qa.startWork() method usage when finding Developer.startWork() usages?

like image 613
Chamly Idunil Avatar asked Nov 30 '15 07:11

Chamly Idunil


Video Answer


1 Answers

Using Ctrl+Shift+Alt+F7 (+++F7 for Mac) should show the prompt from Jim Hawkins answer.

See: https://www.jetbrains.com/help/idea/find-usages-method-options.html

When you search for usages of a method implementation with this dialog Ctrl+Shift+Alt+F7, IntelliJ IDEA will ask whether or not you want to search for the base method. With any other find usages actions such as Alt+F7 or Ctrl+Alt+F7, the base method will be included in the search results automatically.

like image 159
Louis Tetevide Avatar answered Sep 17 '22 00:09

Louis Tetevide