How do I write a custom search filter to weed out R.java files? [duplicate]
Asked Answered
L

1

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.

Lance answered 16/4, 2015 at 18:3 Comment(2)
It's VERY easy to look ONLY in R.java files. But who needs that?Kirkwood
@ScottBiggs I think no one does. That is why I wish to exclude all R.java files.Lance
L
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.

Lance answered 2/6, 2015 at 18:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.