Developing plugin for Rider
Answered
I am attempting to get a simple module to show up in Rider. So far I can get it to show up in Intellij, but I am guessing my plugins.xml file or my external dependencies are incorrect. Below is the plugin.xml parts that would matter followed by a stacktrace that I get when I attempt to set my run configuration to Rider.
What do I need to add besides this? And I set my run configuration to point to Rider's directory (exactly how I set it to launch in Webstorm/Pycharm).
<depends>com.intellij.modules.lang</depends>
<extensions defaultExtensionNs="com.intellij">
<moduleType id="RIDER_TEST" implementationClass="com.example.package.TestModule"/>
</extensions>
Here is the stacktrace I get when I fire it up in Rider:
Internal error. Please report to http://jb.gg/ide/critical-startup-errors
com.intellij.ide.plugins.PluginManager$StartupAbortedException: java.lang.reflect.InvocationTargetException
at com.intellij.ide.plugins.PluginManager$2.run(PluginManager.java:95)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.ide.plugins.PluginManager$2.run(PluginManager.java:92)
... 1 more
Caused by: java.lang.RuntimeException: Cannot load resource: /idea/IdeaApplicationInfo.xml
at com.intellij.openapi.application.impl.ApplicationInfoImpl.<init>(ApplicationInfoImpl.java:205)
at com.intellij.openapi.application.impl.ApplicationInfoImpl.getShadowInstance(ApplicationInfoImpl.java:574)
at com.intellij.idea.StartupUtil.startLogging(StartupUtil.java:378)
at com.intellij.idea.StartupUtil.prepareAndStart(StartupUtil.java:132)
at com.intellij.idea.MainImpl.start(MainImpl.java:34)
... 6 more
Caused by: java.io.FileNotFoundException: /idea/IdeaApplicationInfo.xml
at com.intellij.openapi.util.JDOMUtil.loadDocument(JDOMUtil.java:351)
at com.intellij.openapi.application.impl.ApplicationInfoImpl.<init>(ApplicationInfoImpl.java:201)
... 10 more
Thanks for any direction!
Please sign in to leave a comment.
I would love to know this as well. I'm fairly familiar with the processing for making plugins for PyCharm and Intellij but have not been able to get one to work for Rider no matter what i try so far.
Plugins are not currently supported, as we're still working on the core architecture and feature set.
However, you can get a plugin working by creating a normal IntelliJ plugin, but pointing the SDK to the Rider install folder. You also need to add `-Didea.platform.prefix=Rider` to the VM options in the run configuration.
Is there a timeline for when plugins will be supported?
Will there be Rider-specific documentation on developing plugins for Rider?
No, there isn't a timeline right now. Hopefully this is something we can address before 1.0, with documentation, but there are other higher priority items to work on just now.
First steps - we've just published a blog post that describes how to develop a plugin to the front end of Rider. This is essentially an IntelliJ plugin that can add features to the IntelliJ UI "front end" of Rider. It cannot yet interact with the ReSharper based "back end", so right now, you can't create an analyser, or refactoring, etc. But you can create some kind of stand alone plugin to run in Rider, such as a tool window, etc.
But there are plans to supports plugins for the backend in the future, correct? But on the front end, its good it hear that my knowledge about making plugins for idea and PyCharm will apply here as well. So if i understand, if i wanted to make a plugin for add extra information to the gutter line of a CS file, i have no way of getting data about symbols in the code.
Yes, absolutely. Backend plugins will be essentially the same as ReSharper plugins, and the Rider plugin will contain an IntelliJ part and a ReSharper part. Anything that needs access to the structure of a C# file will live in ReSharper, including inspections, refactorings, and even highlights, including gutter icons. We have proof-of-concept level support for backend plugins at the moment - the Unity plugin is basically a repackaged version of the ReSharper plugin, with only minor code changes.
The problem at the moment (aside from lack of an SDK) is that our custom protocol for talking between IntelliJ and ReSharper is not extensible, so there is no way for a Rider front end plugin to communicate with the ReSharper backend. But that will come.
cool sounds great, so on the intellij side of things, is where i would do stuff like adding actions, or new run/debug configurations correct. But stuff like working with PSI trees and elements would all be on the resharper backend if i understand.
Yep. Exactly.
Hi Matt - can you update where this is at. The linked blog post says "While JetBrains is still working on a full SDK for Rider, it is already possible to make a plugin for it – at least for the front-end part."
I have the same issue as the OP where my plug in does not appear in the Main Menu. Is adding a plug in to the Main Menu of Rider supported yet?
Yes, frontend plugins can definitely work with Rider - these are just IntelliJ plugins. To make it compatible with Rider, you'll need to make sure your plugin.xml file contains the following:
<depends>com.intellij.modules.rider</depends>
Thanks - that's fixed it - cheers for your help.