如何编写自定义搜索过滤器以清除R.java文件?

时间:2015-04-16 18:03:31

标签: intellij-idea android-studio file-search

我正在尝试在Android Studio中创建自定义搜索àHow to exclude a file extension from IntelliJ IDEA search?以下模式如何排除R.java个文件?

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

请注意,第二个使用&&!file:R.java,但范围不包含更少的文件。

1 个答案:

答案 0 :(得分:0)

问题是必须考虑文件的路径。 !file:R.java仅查找根目录中的R.java。要查找所有R.Java文件,必须使用!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

请注意,第二个使用&&!file:*/R.java,范围包含的文件较少。