How to add icon to linemarker?
Answered
Hello, followed this tutorial https://www.jetbrains.org/intellij/sdk/docs/tutorials/custom_language_support/line_marker_provider.html.
i created my class for my marker, but when and where i need to call this class to add icon to line? can you help me? In best case i would like to add icon next to line when i edit current line, i work here with PsiTreeChangeListner. Thanks for help, i am new to this.
public class CustomLineMarker extends RelatedItemLineMarkerProvider {
@Override
protected void collectNavigationMarkers( @NotNull PsiElement element,
@NotNull Collection< ? super RelatedItemLineMarkerInfo > result ) {
NavigationGutterIconBuilder< PsiElement > builder =
NavigationGutterIconBuilder.create(IconLoader.getIcon("resources/META-INF/fail.png"))
//TODO ADD PSI ELEMENT
.setTargets( element )
.setTooltipText( "Navigate to Simple language property" );
result.add( builder.createLineMarkerInfo( element ) );
}
}
```
Please sign in to leave a comment.
Wibrach,
You can find the exact instructions on how to do that in the next part of the documentation:
8.3. Register the Line Marker Provider