How to write a plugin for multiple Platform SDKs?

Hi.  I've written a plugin for Intellij IDEA and Android Studio (Java, Kotlin, and JavaScript).  Now I would like to extend the plugin to work also with Rider (C#).  However, when I change the Platform SDK to Rider I cannot compile my plugin anymore since Rider does not contain the Java language support (`` dependency).  How can I solve this?  What's the best practice to write plugins for multiple Platform SDKs?


It seems that I can add the idea*.jar, openapi.jar, resources.jar from an IDEA installation to the IDEA Platform SDK and now I can compile the project.

Is this meant to be the suggested way?


You should always build against the IntellIJ sources, but then to test you'd switch to Rider in the Run Configuration or using alternativePath with the gradle plugin.


Rider has a very different model to most other IJ based IDEs - there is no C# PSI inside IntelliJ. All of the parsing, analysis and refactorings are performed out of process in a ReSharper instance, running as a headless service. It is possible to write a plugin for Rider - but you'll likely have to split the code. Any IntelliJ frontend behaviour is a standard IJ based plugin, while any C# interaction must be a ReSharper plugin. This is the approach we're taking for the Unity plugin - it's a ReSharper plugin that provides analysis, highlighting and so on, and an IntelliJ plugin that packages the ReSharper extension and provides additional functionality (settings pages, Unity specific run configurations, etc.)


Thanks for your replys, guys!

I did not know that the main part of Rider is actually ReSharper which is written in C#.  So I guess my plan of 'just integrating C# support in my plugin' is not working that way.  So I would have to port my whole plugin to C#/ReShaper and would have to managing two code bases.  That's is too time consuming for me, especially since Rider will probably supersede Visual Studio anyway.  And when this is done ReSharper is not needed anymore and can be directly integrated into the IJ platform.

By the way, thanks for Rider!  It's so much better than Visual Studio!  It's so pleasant to work with an IDE that is not flickering on each popup.  I wonder if MS will ever learn the concept of double buffered canvases.


Please sign in to leave a comment.