I want to implement a plugin for rider, that adds custom language support for a custom file type that mostly just contains C# code.
I’m having trouble finding the right way to achieve it. I find it unclear where / how custom languages are declared, due to the split between IntelliJ Plattform and ReSharper.
I tried the following:
-
declaring custom language + file in java, registered in plugin.xml → icon is used, parser runs
BUT having a token that has injected C# only results in basic syntax highlighting; decompiled java only has C# dummy parser, not sure whats doing on -
declaring custom language + file in C#; unable to reference C# in plugin.xml → language + file declarations are instanciated, parser runs on open file
BUT icons never used / not shown, lexer and parser result doesn’t seem to be consumed, psi viewer doesn’t have the custom language listed in the dropdown
So my question is:
Wanting to have a custom language, with C# bits scattered about. What parts does the C# / java side have to play? (must i declare language in C# and java? how to inject C#, with autocomplete working - must this be done by C#?)
Is there a example where C# / a other language is injected, working in rider. (i know that regex in c# literals, C# in razor is injected; but i’m confused by C#, Regex, Razor classes and PSI implementations existing in both C# and java with different implementations. it doesn’t help that the decompiled parsers aren’t very readable) Or can someone explain, where language features (syntax highlighting, auto complete…) have to be implemented, or which docs are supposed to be considered / can be ignored for this usecase
Thanks for any help / knowledge