I’m developing a custom language plugin.
The language support @xxxx to refer to xxxx argument defined some other golang files
I tried to add an annotator for those “@xxxx” element to make it
display in red color when there is no “xxxx” argument it can refer to.
final class MyAnnotator implements Annotator {
@Override
public void annotate(@NotNull final PsiElement element, @NotNull AnnotationHolder holder) {
...
}
}
But it seems like that then annotator is never called.
I have some similar annotator, it works for yaml. So I guess to support annotator, custom language PSI element should implement some special methods ? ( Just like this issue )
When I create a new language support plugin I usually start highlighting the code nodes.
I use Annotators to highlight nodes that aren’t leaf, because there no other way.
As far as I remember there were no big issues with doing so.
Here is how .gitattributes plugin looks like inside: