Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » OSX code completion for jruby/ruby not complete
OSX code completion for jruby/ruby not complete [message #956700] Wed, 24 October 2012 18:43 Go to next message
Al Bundy is currently offline Al BundyFriend
Messages: 27
Registered: November 2011
Junior Member
I'd like to use DLTK to develop some ruby and jruby scripts.
This works good in most cases.

Unfortunately code completion is not complete for default-classes (e.g. String)

"".d shows only dclone() as proposal instead of
.delete .delete! .detect .display .downcase .downcase!
.drop .drop_while .dump .dup

Is there a possibility to fix this?

Tested on OSX with Juno and DLTK 2.0 ruby 1.8.7, jruby 1.6.5, jruby 1.7.0
Windows with Helios and jruby 1.6.8

Just another question: Is it possible to enable code completion for java-classes in jruby-scripts?

Thanks

Al

[Updated on: Wed, 24 October 2012 18:44]

Report message to a moderator

Re: OSX code completion for jruby/ruby not complete [message #958122 is a reply to message #956700] Thu, 25 October 2012 19:28 Go to previous messageGo to next message
Alex Panchenko is currently offline Alex PanchenkoFriend
Messages: 342
Registered: July 2009
Senior Member
Hi,

On 10/25/2012 01:43 AM, Al Bundy wrote:
> I'd like to use DLTK to develop some ruby and jruby scripts.
> This works good in most cases.
>
> Unfortunately code completion is not complete for default-classes (e.g.
> String)
>
> "".d shows only dclone() as proposal instead of delete .delete!
> .detect .display .downcase .downcase! drop
> .drop_while .dump .dup
> Is there a possibility to fix this?

That's strange. DLTK executes the following script to fetch the actual
members from the runtime environment:

http://git.eclipse.org/c/dltk/org.eclipse.dltk.ruby.git/tree/plugins/org.eclipse.dltk.ruby.launching/scripts/builtin.rb

Could you check if this script reports all the members in your environment?

>
> Tested on OSX with DLTK 2.0 ruby 1.8.7, jruby 1.6.5, jruby 1.7.0
> Windows with jruby 1.6.8
>
> Just another question: Is it possible to enable code completion for
> java-classes in jruby-scripts?

That's not implemented yet.

>
> Thanks
>
> Al

Regards,
Alex
Re: OSX code completion for jruby/ruby not complete [message #958185 is a reply to message #958122] Thu, 25 October 2012 20:43 Go to previous messageGo to next message
Al Bundy is currently offline Al BundyFriend
Messages: 27
Registered: November 2011
Junior Member
I've extracted org.eclipse.dltk.ruby.launching_1.0.0.v20100524-0038.jar to the folder org.eclipse.dltk.ruby.launching_1.0.0.v20100524-0038 replaces the builtin.rb and added puts "..." to the builtin.rb and restartet eclipse with -clean -consoleLog.

Method-list is still not complete and I haven't seen any "..." in console.

Al
Re: OSX code completion for jruby/ruby not complete [message #958499 is a reply to message #958185] Fri, 26 October 2012 02:39 Go to previous messageGo to next message
Alex Panchenko is currently offline Alex PanchenkoFriend
Messages: 342
Registered: July 2009
Senior Member
> Method-list is still not complete and I haven't seen any "..." in console.

Output is not printed to the console, it is processed by DLTK.
Could you execute that script manually from the command line to check
the output?

Also, if I remember correctly, result is cached for some time, so DLTK
might not executed it every launch.

Regards,
Alex
Re: OSX code completion for jruby/ruby not complete [message #959538 is a reply to message #958499] Fri, 26 October 2012 20:06 Go to previous messageGo to next message
Al Bundy is currently offline Al BundyFriend
Messages: 27
Registered: November 2011
Junior Member
The results from manual execution for 1.6.8 and generic ruby looks good (see atachments) - but downcase and upcase are still missing in proposals.

x_o in filename means that I had to enable object-space via argument -X+O

I've found out, that the model seems to bee stored in .metadata/.plugins/org.eclipse.dltk.launching/model.xmi
So I tried to delete the file - but after a restart the file was nearly empty (no value-tags).

Than I switched from ruby to jruby-interpreter (1.6.Cool and restarted eclipse.
Now downcase und upcase are still missing but model.xmi contains the currect output (including down- and upcase).
Re: OSX code completion for jruby/ruby not complete [message #959548 is a reply to message #959538] Fri, 26 October 2012 20:15 Go to previous messageGo to next message
Al Bundy is currently offline Al BundyFriend
Messages: 27
Registered: November 2011
Junior Member
model.xml includes now the correct output - but methods are still missing in proposals...

[Updated on: Fri, 26 October 2012 20:16]

Report message to a moderator

Re: OSX code completion for jruby/ruby not complete [message #959706 is a reply to message #959548] Fri, 26 October 2012 23:16 Go to previous messageGo to next message
Al Bundy is currently offline Al BundyFriend
Messages: 27
Registered: November 2011
Junior Member
The problem is really because of the objectspace-flag.
On windows and osx I could get the proposals working with this steps:

1. modify jruby-script (jruby.bat or jruby.sh or jruby) and add the parameter -X+O to the ruby-executable (use JRUBY_OPTS or add it to jruby.exe)
2. use modified file as interpreter
3. if not done automatically add the libraries
4. delete workspace/.metadata/.plugins/org.eclipse.dltk.launching/model.xmi
5. restart eclipse

the deleted file in step 4 will be generated again and will contain the output of builtin.rb and now the proposals should work.
Re: OSX code completion for jruby/ruby not complete [message #959797 is a reply to message #959706] Sat, 27 October 2012 01:07 Go to previous message
Al Bundy is currently offline Al BundyFriend
Messages: 27
Registered: November 2011
Junior Member
Now that I have a workaround for my problem (works on osx and windows) I have a new one.

I've required 'java' but all Methods from the are missing - e.g. to_java, java_method, ... (java_kind_of? is part of the proposals).
In the xml-File there is not method with "java" in name.

Can you also please explain how to use user-libs like the generated files from the builtin.rb?
If there is no code-completion for java I want to generate my own dummy-modules for code-completion.

[Updated on: Sat, 27 October 2012 01:21]

Report message to a moderator

Previous Topic:Can I help out with DLTK Ruby?
Next Topic:parsing a configuration file that is expressed in ruby dsl
Goto Forum:
  


Current Time: Thu Apr 25 08:16:04 GMT 2024

Powered by FUDForum. Page generated in 0.03997 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top