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() {
                    @NotNull
                    protected SyntaxHighlighter createHighlighter() {
                        return null;
                    }
                });
            }
        }
        System.out.println("Initing Custom Component");

    }

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

    @NotNull
    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 (http://www.jetbrains.net/devnet/community/idea/open_api_and_plugin_development). 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.

0

Please sign in to leave a comment.