Annotator for all files?

Hi,

I'm investigating adding an annotator for all files in a project.  My goal is to provide error feedback on custom types in Gosu based solely on the Gosu type system, which can tell me the types for a given file/virtualfile and the errors (if any) in that type.  I've tried the following in my plugin.xml:

  <annotator implementationClass="gw.plugin.ij.lang.parser.GosuOpenTypeAnnotator"/>

  <annotator language="*" implementationClass="gw.plugin.ij.lang.parser.GosuOpenTypeAnnotator"/>

  <annotator language="All" implementationClass="gw.plugin.ij.lang.parser.GosuOpenTypeAnnotator"/>



But none of them worked.  What's the correct way to do this?

Thanks,
Carson
7 comments
Comment actions Permalink

You can iterate the registered languages and register the annotator extension for them programmatically. Extensions registered via plugin.xml are always associated with a specific language.

0
Comment actions Permalink

Ah, OK.  Would this include "text" files, just in case third party typeloaders work againts a resource that IJ does not have a language definition for?  (I would guess yes, just want to be sure.)

Also, if you have it off the top of your head, what classes should I use to find the languages and register the extension?

Thanks!
Carson

0
Comment actions Permalink

This would include text files, but would not include files with an unknown filetype.
Language.getRegisteredLanguages() and LanguageAnnotators.INSTANCE.registerExplicitExtension()

0
Comment actions Permalink

Works beautifully.  Thanks!

0
Comment actions Permalink

OK, last question:  how can I get IJ to re-annotate an entire editor, given a virtual file?  

Basically, we reparse the resource in the background and at that point we may have generated more errors, and we need to let IJ know to reannotate the entire editor for the file.

Thanks again for all your help!
Carson

0
Comment actions Permalink

DaemonCodeAnalyzer.getInstance(project).restart(psiFile)

0
Comment actions Permalink

Dmitry, you are a gentleman and a scholar:

  http://vimeo.com/34482632

Beers on me next conference!

0

Please sign in to leave a comment.