I want create a plugin which will support C Sharp language

Origin question :

In this case 

<annotator language="JAVA" implementationClass="com.github.izhangzhihao.rainbow.brackets.RainbowBrackets"/>

will work for java language, but when I try to support C# , I tried "C#" and "CSharp", it does not work, I want to know which language name I need to use , it there any doc for that? thanks!

Update :

 @Yann Cebron said that I should use "C#" as language id. But actually it does not works,more info see here 

I tried remove "language" attribute in annotator-registration like this as well:

<extensions defaultExtensionNs="com.intellij">
       <annotator implementationClass="com.github.izhangzhihao.rainbow.brackets.RainbowBrackets"/>

Sadly it does not work for any languages 😭.

Plugin code source in here : https://github.com/izhangzhihao/intellij-rainbow-brackets

More info : https://youtrack.jetbrains.com/issue/IJSDK-324

Official comment

Hello Zhihao Zhang!

C# support is entirely different from other languages in IJ platform, and is implemented in our language server process powered by ReSharper.

The IJ support layer is so tiny we don't even have a parser, what's why your annotator for coloring braces doesn't succeed.

The good thing however is that in 2017.3 will provide light-weight parser for C# files which should be enough for needs of Rainbow Brackets plugin.


@Alexander Kirsanov Great Rider team! I will try after Rider-2017.3 released! So much thanks!


@Alexander Kirsanov tried on Rider 2017.3 release, doesn't work, any update on that?


Hello, unfortunately this task has been postponed to future releases. Current estimates are 2018.1-2018.2


@Alexander Kirsanov Well... Thanks anyway.


 @Alexander Kirsanov

Do you plan to bring more feature from the IJ platform to Rider?  E.g. Postfix templates?  I mean I would like to make my plugin "Custom Postfix Templates" to work with Rider.


@Alexander Kirsanov


Should we assume this is leaning more towards the 2018.2 side of things?


Hello @Stefan Endrullis, if you want to create a plugin which needs to know the language structure of C#/VB/F#/XAML/any other technology fro .NET stack, you need to write that part in C# as a plugin for R# process we use to provide all PSI-related features, take a look at resharper-unity or fsharp-support for example of Rider plugins with C# part. Hopefully soon we'll get more systematic and accurate documentation covering the aspects of such development


@Jslowik we provided lightweight parsing for C# on IJ side of Rider, but it will be available starting from the first 2018.3 EAPs.
Please follow the related issue RIDER-16744 

Stefan Endrullis

@Alexander Kirsanov

Thanks for the hint, but I don't want to reimplement my existing plugin just for ReSharper.  That's just to much work and for a single language and I also don't want to maintain two code bases.  I hope that more and more people will use Rider instead of Visual Studio + ReSharper in future, so that the ReSharper bridge won't be necessary anymore.


Hi guys!

Starting from 2018.3 EAP2 Rider will expose simple version of parser on IJ-side.

So it'll be possible to support C# in rainbow brackets plugin.


Thanks for your patience!



@Alexander Kirsanov:

Thanks for the info.  Do you know when EAP 2 is going to be released?


Sorry for misinformation, this will be added in EAP3 which will take place nearly in a week.

You can also try Rider 2018.3 Nightly builds which already include this. The easiest way to install it is Toolbox app.




Oh. Thanks for the tip. Didn't know that there is such a thing like Toolbox.


I added

<depends optional="true">com.intellij.modules.rider</depends>

to my plugin.xml, but "C#" is still marked red in this line:

<codeInsight.template.postfixTemplateProvider language="C#"

Is it possible to write postfix templates for C# in Java?


Hello Stefan!
Having "C#" marked as unresolved is a bug in IJ plugin.xml support, for now, it doesn't understand com.intellij.lang.Language written in kotlin. This will be fine in a product.

Postfix templates on IJ-side (frontend as we call it) is not a proposed way, since C# layer in quite thin and exist only for internal infrastructure needs. It can be worth experimenting though.


Please sign in to leave a comment.