手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

Intellij idea插件如何查找属性引用的地方

时间:2024-10-15 08:38:32

1、定义一个发现使用的Provider。需要实现FindUsagesProvider接口。如图

Intellij idea插件如何查找属性引用的地方

2、需要提供默认的单次扫描器实例。如图

Intellij idea插件如何查找属性引用的地方

3、在canFindUsagesFor方法中判断是不是PsiNamedElement类蕞瞀洒疸型以及返回的protobuf类型。如图

Intellij idea插件如何查找属性引用的地方

4、从getDescriptiveName属性中获取到描述的名字。如图

Intellij idea插件如何查找属性引用的地方

5、实现getNodeText获取到查找节点的文本名称。如图

Intellij idea插件如何查找属性引用的地方

6、将创建的provider注册到plugin.xml文件中的扩展配置中。如图

Intellij idea插件如何查找属性引用的地方

7、最后运行工程,就可以查找属性的在哪些地方被使用了。

Intellij idea插件如何查找属性引用的地方
© 手抄报圈