IntelliJ Idea Ruby plugin/JRuby facet Questions

I develop JRuby code for Elastic as a member of the Logstash team.

Usually I develop some Java classes and then some JRuby specific code in Java aka a JRuby extension. This extension is in the jar and defines Ruby modules and classes to 'wire' up the Java code into the JRuby runtime.

e.g.

public class JavaDissectorLibrary implements Library {

@Override
public void load(Ruby runtime, boolean wrap) throws IOException {
RubyModule module = runtime.defineModule("LogStash");

RubyClass clazz = runtime.defineClassUnder("Dissector", runtime.getObject(), new ObjectAllocator() {
@Override
public IRubyObject allocate(Ruby runtime, RubyClass rubyClass) {
return new RubyDissect(runtime, rubyClass);
}
}, module);

clazz.defineAnnotatedMethods(RubyDissect.class);
}
}

Now on the ruby side in the dissect.rb file the IntelliJ does not know about LogStash::Dissector class and its methods.

But for other Ruby classes in gems or source the IDE does provide method completion, i.e full IDE support.

I would love see support for Ruby as defined in JRuby extensions, but I don't understand the mechanisms involved.

Does the Ruby plugin only get its intelligence from static analysis?

What does the JRuby facet actually do?

 

 

 

1 comment
Comment actions Permalink

Hello,

sorry for the delay. JRuby facet is for Java classes and methods completion in Ruby code. As far as I understood, you'd like to have completion for Ruby class declared via API, if that's the case then, unfortunately, we don't support it at the moment.

That would be great if you could submit it to our tracker:

http://youtrack.jetbrains.com/issues/RUBY

If you are not familiar with YouTrack, then please refer to

https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications

0

Please sign in to leave a comment.