Syntax Highlighting Plugin for Java

I want to create a simple plugin that will highlight methods, classes, and fields based on the existence of annotations (Java).

Here's what I have so far.  Any guidance would be great.  Thanks.

public class AnnotationSyntaxHighlighter implements ApplicationComponent {
    public AnnotationSyntaxHighlighter() {

    public void initComponent() {
        final Collection<Language> languageCollection = Language.getRegisteredLanguages();
        for (Language language : languageCollection) {
            if (language.getDisplayName().equalsIgnoreCase("java")) {
                SyntaxHighlighterFactory.LANGUAGE_FACTORY.addExplicitExtension(language, new SingleLazyInstanceSyntaxHighlighterFactory() {
                    protected SyntaxHighlighter createHighlighter() {
                        return null;
        System.out.println("Initing Custom Component");


    public void disposeComponent() {
        // TODO: insert component disposal logic here

    public String getComponentName() {
        return "com.infusionsoft.intellij.AnnotationSyntaxHighlighter";

1 comment
Comment actions Permalink

Hello Eric,

I would suggest moving this post to the Open API and Plugin Development forum ( You'll likely get better responses there. (I'd recommend posting a link to the new post in this one so folks can find it.)

Good luck with your plugin.


Please sign in to leave a comment.