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

2024-10-15 08:38:32

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

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

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

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

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

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

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

Intellij idea插件如何查找属性引用的地方
猜你喜欢