Intellij:查找用法,但从结果中排除测试文件


80

有谁知道如何从使用结果中排除测试文件?

就像下面的所有内容一样:src / test /

Answers:


40

Intellij Ultimate 11版本具有在“项目生产文件”中搜索的选项。

只需在用法上按Alt+ F7,然后在“范围”上查看即可。


“项目生产文件”也在社区版本中。
Vishrant



18

您可以创建自定义搜索范围

范围是项目中文件,程序包和/或目录的子集,可以在其中限制特定操作的应用,例如搜索,代码检查,版权声明的插入等。

Edit -> Find -> Find Usages Settings...

在此处输入图片说明

使用方式

!file:*Test.java!file:*Test.java&&!file:*Tests.java!test:*.*&&!test:*

您可以找到的所有范围

Android Studio -> Preferences -> Appearance & Behavior -> Scopes  

您也可以使用语法自定义模式

[跳过生成模式]

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.