Very very thanks Matthias,
you are completely right - now it works like a charm. I thought the gramma file 
was found in the source folder because if I give a wrong file name in the 
annotation

@GrammarRegistration(grammar="ocga.tmLanguage.json", mimeType="text/x-ocga")

I got an error. Do I thought, if the annotation finds the grammar file in the 
source folder all is ok but it is not. 

The gramma file is found only to compile time but not during runtime. During 
runtime the gramma file must be in the resource folder as you write!!!

best regards
Oliver
> Hi Oliver,
> 
> Am Mittwoch, dem 28.06.2023 um 20:34 +0200 schrieb Oliver Rettig:
> > I have implemented a simple netbeans plugin for my .ocga-files:
> > 
> > https://github.com/orat/netbeans-ocga
> > 
> > The files are correctly recognized, the registered icon is shown in the
> > file- nodes.
> > 
> > The textmate file is found but in the editor nothing happens. No syntax-
> > highlighing is shown. Also newstart of the ide has no effect.
> > 
> > The textmate-file works fine in visual-studio.
> > 
> > Any ideas what can be wrong?
> 
> I doubt, that the grammar file is found. The maven project structure is
> incorrect. Maven expects, that in the src/main/java directory only java
> files are found. Everything else is ignored.
> 
> Runtime resources (the grammar file is such a resource), that are to be
> packed into the final jar need to be in the src/main/resources folder.
> This differs from antlr where the grammar file is used at compile time
> and not used at runtime and thus does not need to be packaged.
> 
> TL;DR: Move
> src/main/java/de/orat/math/netbeans/ocga/ocga.tmLanguage.json to
> src/main/resources/de/orat/math/netbeans/ocga/ocga.tmLanguage.json and
> it works.
> 
> Greetings
> 
> Matthias
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
> For additional commands, e-mail: dev-h...@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
For additional commands, e-mail: dev-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to