Can RelatedItemLineMarkerProvider navigate to special line?

Answered

Hi, I am in trouble on my plugin development, is there any way navigate to the special line when navigate in to my file?

I didn't find any method to set line number or special marker in NavigationGutterIconBuilder

var markInfo = NavigationGutterIconBuilder.create(XqlIcons.FILE)
.setTargets(xqlFile)
.setTooltipText(xqlFileName + " -> " + sqlName)
.createLineMarkerInfo(element);
result.add(markInfo);

Question:

  1. I hope the cursor locate to 10th line when click navigation gutter icon;
  2. btw can Command+Mouse Left Click on &my.users navigate like RelatedItemLineMarkerProvider?
0
5 comments
.createLineMarkerInfo(element);

这里的element只要是/*[users]*/的psi element 就可以直接导航过去

 

1

Line markers are installed on specific PsiElement

1

Shicuining 感谢提供思路,真的可以了!!!

我代码没发完整,这个element是当前文件,你说的应该是:

.setTargets(xqlFile)

这个是完整的代码,暂时通过这样别扭的方式来实现,可能效率挺低的,看看以后重构优化下。

0

是的,setTargets,说反了

0

Please sign in to leave a comment.