FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Code completion for library module

 
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users
View previous topic :: View next topic  
Author Message
Masaki Katakai
Posted via mailing list.





PostPosted: Mon Jan 26, 2009 8:00 am    Post subject: Code completion for library module Reply with quote

Hi Team,

I have a simple question : how to enable code completion
for external library module?

One community member in Japan is asking about code completion.
He tried to use Magick module and NetBeans 6.5 on Mac. He is
using native Ruby of Mac port.

$ sudo port install ImageMagick
$ sudo port install rb-rmagick
$ sudo port install ruby

The example is here.

require 'RMagick'
include Magick

It seems that code completion is not working for Magick module.
RMagick.rb file is located under /opt/local/lib/ruby/vendor_ruby/1.8.
The program can find the RMagick.rb file at running and work properly. But
how to enable code completion on NetBeans editor?

When I copied RMagick.rb to lib/ folder (same folder of main Ruby file)
of NetBeans project, the code completion starts working.

Regards,
Masaki
Back to top
Martin Krauskopf
Posted via mailing list.





PostPosted: Tue Jan 27, 2009 10:20 am    Post subject: Code completion for library module Reply with quote

Masaki Katakai wrote:
Quote:
Hi Team,

I have a simple question : how to enable code completion for external
library module?

One community member in Japan is asking about code completion. He
tried to use Magick module and NetBeans 6.5 on Mac. He is using native
Ruby of Mac port.

$ sudo port install ImageMagick
$ sudo port install rb-rmagick
$ sudo port install ruby

The example is here.

require 'RMagick'
include Magick

It seems that code completion is not working for Magick module.
RMagick.rb file is located under /opt/local/lib/ruby/vendor_ruby/1.8.
The program can find the RMagick.rb file at running and work properly.
But how to enable code completion on NetBeans editor?

Hi Masaki,

I've just tried with NetBeans 6.5 and it works for me. Several tips:

1) do you have set the right platform for the project? I.e. MRI, not
bundled JRuby or other platform.
- http://wiki.netbeans.org/FaqRubyPlatformPerProject

2) seems that the gem was installed from CLI. Does NetBeans restart help?

3) Can you see 'rmagick' gem installed in 'Menu | Tools | Ruby Gems' for
the platform to which the project is set?

m.
Back to top
Masaki Katakai
Posted via mailing list.





PostPosted: Wed Jan 28, 2009 6:48 am    Post subject: Code completion for library module Reply with quote

Hi Martin, Thank you very much for the great tips!

Quote:
3) Can you see 'rmagick' gem installed in 'Menu | Tools | Ruby Gems' for
the platform to which the project is set?

No.3 is the problem! I can not find "rmagick" on the gem for the platform.
Once I installed rmagick into gems of the platform, it started working!

Thanks again!

Masaki

09.1.27 7:20 PM, Martin Krauskopf wrote:
Quote:
Masaki Katakai wrote:
Quote:
Hi Team,

I have a simple question : how to enable code completion for external
library module?

One community member in Japan is asking about code completion. He
tried to use Magick module and NetBeans 6.5 on Mac. He is using native
Ruby of Mac port.

$ sudo port install ImageMagick
$ sudo port install rb-rmagick
$ sudo port install ruby

The example is here.

require 'RMagick'
include Magick

It seems that code completion is not working for Magick module.
RMagick.rb file is located under /opt/local/lib/ruby/vendor_ruby/1.8.
The program can find the RMagick.rb file at running and work properly.
But how to enable code completion on NetBeans editor?

Hi Masaki,

I've just tried with NetBeans 6.5 and it works for me. Several tips:

1) do you have set the right platform for the project? I.e. MRI, not
bundled JRuby or other platform.
- http://wiki.netbeans.org/FaqRubyPlatformPerProject

2) seems that the gem was installed from CLI. Does NetBeans restart help?

3) Can you see 'rmagick' gem installed in 'Menu | Tools | Ruby Gems' for
the platform to which the project is set?

m.
Back to top
Ratix



Joined: 23 Feb 2009
Posts: 1

PostPosted: Mon Feb 23, 2009 3:40 pm    Post subject: Reply with quote

Hi,
Martin's tips solves the problem with ImageMagick, but it don't help with ruby-opengl. It may be caused by "different" structure of opengl.rb file (in RMagick ruby file there is full list of methods, in ruby-opengl not). Everything seems great, scripts run without any problem, but code completion doesn't work... Does anyone have an idea?

Regards,
Ratix
Back to top
View user's profile Send private message
Erno Mononen
Posted via mailing list.





PostPosted: Mon Feb 23, 2009 4:31 pm    Post subject: Code completion for library module Reply with quote

Hi Ratix,

Ratix wrote:
Quote:
Hi,

Martin's tips solves the problem with ImageMagick, but it don't help with ruby-opengl. It may be caused by "different" structure of opengl.rb file (in RMagick ruby file there is full list of methods, in ruby-opengl not).

The IDE needs at least stubs for methods to be able to index them (or
some specific support, such as what we have for Rails' dynamic methods).
If ruby-opengl doesn't contain the methods it provides in a ruby file,
then the IDE isn't able to index those methods.


Quote:
Everything seems great, scripts run without any problem, but code completion doesn't work... Does anyone have an idea?


I think it would be possible to generate stubs for ruby-opengl the same
way as we do for the standard library, but since there is not much
documentation available on the generation process it is difficult for
anyone not from the dev to do it. But I need to still look at our
generator and see whether it would work for any library.

Erno
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB