Gutter Icon

I am trying to show a gutter icon for a function in a custom language plugin using an annotation. The problem is that if one of the child nodes has an error then the gutter icon is not shown. Is there a solution to this?

0
6 comments

Create your annotation for a leaf element, token (like name identifier).
Then there won't be any problematic children.

0

Debugging the annotate method, the node containing the children with errors is never passed as a parameter. Fixing the errors resolves this.

I am using TextRange on subset of an identifier, is that the same as applying annotations to a leaf node?

0

You just analyze the leaf element instead of its parent in your
annotate() method and give the respective text range. BTW a more
user-friendly way of providing gutter icons is to implement
LineMarkerProvider extension.

0

The LineMarkerProvider sounds like a good solution. Are there any examples where this is used? There is not a lot documentation in the OpenAPI.

0

There are LineMarkerProvider's in JavaScript, Python, Ruby, Spring
open-source plugins.

0

Thank you. I found an example in the Javascript plugin.

0

Please sign in to leave a comment.