PatPanda
PatPanda

Reputation: 5010

IntelliJ - Filter the out *Test.java classes from global search (shift+shift) result

Small question regarding IntelliJ please.

I am currently running the latest the 2020.3 version of IntelliJ, my question is applicable to both Community and Ultimate version.

By "Global search", I am referring to the search after pressing shift + shift.

So, I have a java class called MyClass.java. and for the class, I have a test class, MyClassTest.java

(I am illustrating this example with one pair of Class.java + ClassTest.java, but as you can imagine, it is for all of them).

When I global search "MyClass", the result that always some first is for some reason "MyClassTest.java" 🤯

How can I configure IntelliJ to filter out all Test.java, or at least, put MyClass.java as first result instead of MyClassTest.java please?

Thank you

Upvotes: 1

Views: 164

Answers (1)

Andrey
Andrey

Reputation: 16381

my question is really about the result of a global search, where I do not know the name of the class for instance

Why don't use Go to file for such cases? There you also can specify your custom-created scope where you can exclude files you do not want to include into a search or use the predefined Project production files scope which excludes all test sources.

enter image description here

For quick access use the shortcut for Go To File action, then to activate the scope use corresponding shortcuts in Go To File popup:

enter image description here

Upvotes: 1

Related Questions