如何让Android Studio停止在搜索结果中返回生成的代码? [英] How do I get Android Studio to stop returning generated code in search results?

查看:70
本文介绍了如何让Android Studio停止在搜索结果中返回生成的代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次在Android Studio中使用Search In Path时,最终都会返回生成的代码作为结果的第一部分.

Every time I use Search In Path in Android Studio, I end up with generated code being returned as the first section of results.

我通常会在*.java,*.xml中搜索某些内容,并且通常会在发现我正在查看Generated Code之前先调查前几个结果.有没有办法忽略生成的代码结果作为结果列表的一部分返回,同时仍然允许搜索读取项目中的所有* .java和* .xml文件?

I usually search for something in *.java,*.xml, and usually investigate the first few results before I realize I'm looking at Generated Code. Is there a way to omit the generated code results from being returned as part of the result list, while still allowing the search to read all of the *.java and *.xml files in my project?

我觉得这是一件非常简单的事情,但是我找不到合适的按钮来切换.

I have a feeling this is something beyond ridiculously simple, but I just can't find the right button to toggle.

同样,加载文件或类型时是否可以忽略生成的类?我一直使生成的MyClass$$ViewInjector类首先出现在打开的文件中,这很烦人...

In the same vein, is it possible to ignore generated classes when loading files or types? I keep getting the generated MyClass$$ViewInjector classes appearing first in open files, and it's just annoying...

推荐答案

我一直在高级搜索中忽略生成的类的方法是将!file:*intermediates*/&&!file:*generated*/&&!lib:*..*添加到新的自定义范围中,例如:

The way I've been doing to ignore generated classes in advanced search is adding !file:*intermediates*/&&!file:*generated*/&&!lib:*..* to a new Custom Scope, like this:

2015年10月14日更新:我也通过从搜索中排除!lib:*..*来改善了模式.谢谢.

14-October-2015 Update: I have improved the pattern by also excluding the !lib:*..* from the search. Thanks.

这篇关于如何让Android Studio停止在搜索结果中返回生成的代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆