1

I'm trying to create a custom search à la How to exclude a file extension from IntelliJ IDEA search? in Android Studio. How come the following pattern doesn't exclude R.java files?

Search for "file:*.java" yielding 1,192 results from 5,256 possible Search for "file:*.java&&!file:R.java" yielding 1,192 results from 5,256 possible

Note that the second uses &&!file:R.java, yet the scope does not contain fewer files.

Community
  • 1
  • 1
Ky -
  • 30,724
  • 51
  • 192
  • 308

1 Answers1

0

The issue is that one must take into account the path of the file. !file:R.java looks only for R.java in the root. To look for all R.Java files, one must use !file:*/R.java:

Search for "file:*.java" yielding 1,203 results from 5,304 possible Search for "file:*.java&&!file:*/R.java" yielding 1,163 results from 5,304 possible

Note that the second uses &&!file:*/R.java, and the scope contains fewer files.

Ky -
  • 30,724
  • 51
  • 192
  • 308