Anyone knows how to exclude test files from find usages results ?
Like everything that is under : src/test/
Anyone knows how to exclude test files from find usages results ?
Like everything that is under : src/test/
I found this answer extremely helpful:
https://stackoverflow.com/a/45958976/5449497
By putting !*Test.java
into the File Mask textfield you can exclude Testfiles from your search results within the project.
Intellij Ultimate 11 version has an option to search in "Project production files".
Just press Alt+F7 on a usage and look on Scope.
IntelliJ IDEA Skip tests files pattern
You are able to create a custom search Scope
A scope is a subset of files, packages and/or directories in your project, to which you can limit the application of specific operations, e.g. search, code inspection, insertion of copyright notices, etc.
Edit -> Find -> Find Usages Settings...
Use pattern
!file:*Test.java
or !file:*Test.java&&!file:*Tests.java
or !test:*.*&&!test:*
All your scopes you can find
Android Studio -> Preferences -> Appearance & Behavior -> Scopes
Also you can customise a pattern by using syntax
BTW: I am using the latest version of Intellij 2020.3
steps to follow:
Display Find Usages Settings dialog (Ctrl + Alt + Shift + F7)
Select your custom scope from the dropdown menu and click on Find
For the second time, Display Find Usages Settings dialog (Ctrl + Alt + Shift + F7)
Additionally, you can combine different conditions like this *.java,!*Test.java -> That is present in *.java files and do not include search from *Test.java files