Performance warning: LineMarker is supposed to be registered for leaf elements only
已回答
I get a warning
eInsight.daemon.LineMarkerInfo - Performance warning: LineMarker is supposed to be registered for leaf elements only, but got: XmlTag:
in the code, I even pass XmlAttribute not XmlTag
if (element !is XmlTag) return
val usages = mutableListOf<XmlAttribute>()
//... fill usages
val subIcon = NavigationGutterIconBuilder.create(AllIcons.Actions.FindForward)
.setTargets(usages)
result.add(subIcon.createLineMarkerInfo(element))
tried to pass element.navigationElement and usages as navigationElement too, doesn't help still shows performance warning
请先登录再写评论。
See https://plugins.jetbrains.com/docs/intellij/line-marker-provider.html#best-practices-for-implementing-line-marker-providers
That is just the sample for PsiMethod->PsiIdentifier in this given case. The assertion message clearly states what is expected, a leaf node.
See org.jetbrains.idea.devkit.references.DevKitRelatedPropertiesProvider#collectNavigationMarkers for sample working
Thanks, helped,