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?
Please sign in to leave a comment.
Create your annotation for a leaf element, token (like name identifier).
Then there won't be any problematic children.
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?
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.
The LineMarkerProvider sounds like a good solution. Are there any examples where this is used? There is not a lot documentation in the OpenAPI.
There are LineMarkerProvider's in JavaScript, Python, Ruby, Spring
open-source plugins.
Thank you. I found an example in the Javascript plugin.