从 Android Studio 的全局搜索中删除 Dagger 生成的类? [英] Remove dagger generated classes from Android Studio's global search?

查看:24
本文介绍了从 Android Studio 的全局搜索中删除 Dagger 生成的类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这真的很烦人.因为匕首2,我需要更多时间去找一些班级.

It is really irritating. I need more time to find some class because of dagger 2.

推荐答案

如果你在谈论生成的 MembersInjectorFactory 类:

If you are talking about the generated MembersInjector and Factory classes:

MyClass_MembersInjector.java
MyClass_Factory.java

您可以通过将它们添加到 File/Settings/编辑器/文件类型 并将适当的通配符添加到 Ignore files and folders 编辑文本:

you can prevent these from coming up in the Ctr-N or Cmd-O dialog by adding them to the ignored files list in File / Settings / Editor / FileTypes and adding the appropriate wildcards to the Ignore files and folders edittext:

*_MembersInjector.java;*_Factory.java; 会导致大部分生成的类被忽略:

*_MembersInjector.java; *_Factory.java; will cause most of the generated classes to be ignored:

之前:

之后:

如果您甚至不想看到生成的组件,您甚至可以将 Dagger*.java 添加到列表中(即使这对项目非常有用).

You can even add Dagger*.java to the list if you don't even want to see the generated component (even though this is rather useful for the project).

更新:

如果您正在谈论不让类出现在自动导入/自动完成中,这是通过设置/编辑器/常规/自动导入完成的:

If you are talking about not having the classes appear in auto-import/auto-complete this is done through Settings / Editor / General / Auto Import:

这篇关于从 Android Studio 的全局搜索中删除 Dagger 生成的类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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