Make plugin compatible with RubyMine _AND_ IDEA Ultimate + Ruby plugin

Hi,

I write plugin for RubyMine, but it also can work in IntelliJ IDEA Ultimate with Ruby plugin installed. When I set the next dependency in plugin manifest:

    <depends>com.intellij.modules.ruby<depends>

it successfully loaded in RubyMine, but blocked in IDEA due to unsatisfied dependency. But when I set:

    <depends>org.jetbrains.plugins.ruby</depends>

then loads in IDEA, but fails in RubyMine %)

So how can I make plugin load BOTH in RubyMine AND Idea+Ruby plugin?

Thank you.

3 comments
Comment actions Permalink

Unfortunately there is no way to make plugin depends on both Ruby plugin and RubyMine.
So, you should either publish two versions of your plugin (one for Idea and one for  RubyMine)
or do not use such dependency in your plugin (if you do not need ruby support).

Regards, Oleg.

0
Comment actions Permalink

Thank you for the answer... It's sad that I cannot solve it using dependencies... My plugin is intended to make life easier to Ruby-developers, so it needs access to some ruby API (like RailsApp etc.). So I have other questions:

1. Can I check presence of other plugins when my plugin is loaded? I mean that plugin can check if it's in IntelliJ or RubyMine. And for IntelliJ it will check that Ruby plugin is installed and if not, it will request it.... Is it possible?
2. What if I specify the only one dependency:

    <depends>com.intellij.modules.platform</depends>

and then in your plugin repository I set manually that my plugin is compatible with IntelliJ and RubyMine?

Thank you.

0
Comment actions Permalink

Hi,

com.intellij.modules.platform is for RubyMine only, so it will not work for Idea+Ruby plugin :(

To check if ruby support is available you could try to find any ruby specific extensions (e.g. com.intellij.lang.parserDefinition)

Something like    
LanguageExtensionPoint[] extensions =
      Extensions.getExtensions(new ExtensionPointName<LanguageExtensionPoint>("com.intellij.lang.parserDefinition"));
for (LanguageExtensionPoint extension : extensions) {
  if ("ruby".equals(extension.language)) {
    return true;
   }
}


Hope this helps, Oleg.
0

Please sign in to leave a comment.