Ignore R.java files in Find results

后端 未结 6 1754
花落未央
花落未央 2020-12-05 06:51

When I do a Find in Path (Ctrl+Shift+F), I often get results under \"Usages in Generated Code\" in R.java files. When I\'m searching my code, I want to do just that: search

6条回答
  •  北海茫月
    2020-12-05 07:35

    I use "custom scopes" in Android Studio to ignore R.java files. Others had described how to create/save a "shared custom scope" which can later be uploaded to a git repository. I'm just gonna share my custom scope string which:

    • ignores R.java files
    • ignores all *.java files generated by Android Annotations (i.e. *_.java files)
    • includes strings.xml, dimens.xml, styles.xml, attrs.xml, colors.xml files
    • includes all xml files in layout/* path

    file:*java&&!file:R.java&&!file:*_.java||file:*strings.xml||file:*dimes.xml||file:*styles.xml||file:*attrs.xml||file:*colors.xml||file:*layout/*xml&&!file:*build/*xml

提交回复
热议问题