how to enable Jruby/java polyglot features in IDEA

Hi...

So I'm evaluating polyglot programming with IDEA X EAP.
I want to try Java import/completion features etc. for JRuby.

Following http://devnet.jetbrains.net/message/5207461#5207461
I setup a new Java Module with a Ruby Facet, added proper JDK
and JRuby as SDKs. I create a new .rb file. I write
require "java"
on top, but editor says no "no such file"

I see completion working for Ruby, but how do I enable polyglot
Java completion etc.?
I must be missing something... :-/

A pointer in the right direction is appreciated....

Thanks!

0
Avatar
Permanently deleted user

Hello Jonathan,

It is a known issue that require "java" shows false positive warning: http://youtrack.jetbrains.net/issue/RUBY-6756
Generally you should get Java completion in any cases when ruby plugin is able to infer proper type of call/local variable, whatever.
Please ensure that you are using Java module type with Java SDK and JRuby facet with JRuby SDK configured.

Regards,
Oleg

0
Avatar
Permanently deleted user

On 11/11/10 15:32, Oleg Shpynov wrote:

It is a known issue that require "java" shows false positive warning: http://youtrack.jetbrains.net/issue/RUBY-6756


ah, ok

Please ensure that you are using Java module type with Java SDK and

JRuby facet with JRuby SDK configured.

I think have

Generally you should get Java completion in any cases when ruby plugin is able to infer proper type of call/local variable, whatever.


hmmm....

I try to reproduce some examples from
http://kenai.com/projects/jruby/pages/CallingJavaFromJRuby


java_import java.lang.System
gives a "cannot find java_import"
oh.... that's RUBY-5523
but completion appears to work for java.*

ok, so let's do
java_import java.util.ArrayList
whatever = Ar...
completion does not offer ArrayList

something else
import J....
ctrl-space offers 5 JavaUtil.... classes


then I try
whetever = Java::
and ctrl-space for completion does not give anything?


Maybe I'm too stupid or this support is really not (yet) what I was
expecting it to be. Probably you should document somewhere with some
small examples just like in the JRuby Wiki what is working and how it is
done.


Thanks!

0
Avatar
Permanently deleted user

As far as some parts of RubyMine are written in JRuby we are aware of the problems described, however we don't have enough resources to fix these problems because our developers are mainly focused on RubyMine 3.0 release. Most likely we'll made some improvements of JRuby coding experience in IntelliJ IDEA after RubyMine 3.0 final release.


Regards,
Oleg

0
Avatar
Permanently deleted user

On 11/12/10 19:59, Oleg Shpynov wrote:

As far as some parts of RubyMine are written in JRuby we are aware of the
problems described, however we don't have enough resources to fix
these problems


Thank you for this clarification.
So essentially, IDEA is not yet "there" to boost JRuby/Java polyglot
programming.

Unfortunately, in order to support you I probably should buy a Rubymine
license, but then you develop all features, which would only appear in
IDEA - I would have to buy another, different license.

Well, I guess I won't buy anything and just wait for the next
generation....

Thanks and keep up the work, not everybody is happy with
the world of Eclipse/Netbeans etc.

J.

0

请先登录再写评论。