Performance warning: LineMarker is supposed to be registered for leaf elements only

Answered

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

 

3 comments
Comment actions Permalink

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

0
Comment actions Permalink

Thanks, helped, 

if (element !is XmlToken) return
val tag = element.parent
if (tag !is XmlTag) return // check XmlTokenType
val usages = mutableListOf<XmlAttribute>()
//... fill usages
val subIcon = NavigationGutterIconBuilder.create(AllIcons.Actions.FindForward)
.setTargets(usages)
result.add(subIcon.createLineMarkerInfo(element))
0

Please sign in to leave a comment.