棉绒如何与Android Studio中的IntelliJ检查集成? [英] How is lint integrated with IntelliJ inspections in Android Studio?

查看:156
本文介绍了棉绒如何与Android Studio中的IntelliJ检查集成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解Android Studio中有两种检查类型,它们是从IntelliJ继承而来的,又是从lint继承来的(请参阅:在命令行中缺少问题组的Android皮棉(与Android Studio中提供的选项相对))。 / p>

我还了解到,当您编写自定义棉绒规则并将其添加到Android项目时,它会自动转换为检查。



基于这两个断言,我相信有一种机制可以将皮棉规则转换为IntelliJ检查。在本文中,它指出使用结构搜索检查是通过IntelliJ IDEA界面创建自定义检查的唯一方法。或者,您可以开发一个外部插件来实现自定义检查。因此,我从中收集到必须有一个皮棉插件,它可以带上棉绒规则并将其转换为检查内容。



我的问题是,是这种情况吗?如果是这样,有人可以指出我该插件的源代码吗?

解决方案

是的,这基本上是正确的。使Android linter适应IntelliJ Inspections API的代码存在于此处。它不是单独的插件;它是Android主要插件的一部分。


I understand that there are two types of inspections in Android Studio, those which are inherited from IntelliJ and those which are inherited from lint (see: Android lint on command-line missing issue groups (versus options available in Android Studio)).

I also understand that when you write a custom lint rule and add it to an Android project it is automatically converted into an inspection.

Based on these two assertions I am lead to believe there is a mechanism which converts lint rules to IntelliJ inspections. In this article it states "Using the Structural Search Inspection is the only way to create custom inspections through the IntelliJ IDEA interface. Alternatively, you can develop an external plugin to implement a custom inspection.". So from this I gather that there must be a "lint plugin" which takes the lint rules and turns them into inspections.

So my question is, is this the case? If so, can someone point me to the source code of this plugin?

解决方案

Yes, this is basically correct. The code that adapts the Android linters to the IntelliJ inspections API lives here. It's not a separate plugin; it's part of the main Android plugin.

这篇关于棉绒如何与Android Studio中的IntelliJ检查集成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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