|
View:
New views
8 Messages
—
Rating Filter:
Alert me
|
|
|
Documentation for Installed Gems is not appearing in the code completionPlease refer to the following lilnk where Tor is walking us through the RubyWebLog demo:
http://netbeans.tv/screencasts/Tor-Norbye-Uses-NetBeans-Ruby-Support-to-Create-a-Weblog-231/ About 2 minutes into the demo and while modifying the 001_create_posts.rb migration, he shows how code completion works inside the migration when he types "t" followed by a "." The code-completion pop-up opens up and the "columns" method is highlighted. The screencast clearly shows the documentation for the ActiveRecord columns method. For some reason, my install does not show it, instead, it displays "No comment found". What puzzles me is that, as soon as I cursor down to any Ruby methods (abort for example), the documentation is immediately displayed. This is happening for all the installed "Gems" and just not the ActiveRecord Gem. So in a nutshell, the documentation is displayed for the Ruby docs but not for the Gems docs. I am using NetBeans 6.1 on Ubuntu 7.10 and the Gems are installed in the /usr/lib/ruby/gems/1.8/gems directory. I can see the docs for the gems installed in a parallel directory, i.e., /usr/lib/ruby/gems/1.8/doc. For some reason, the docs are not being picked up by NetBeans when displaying code completion pop-ups for any gem methods. The documenation is visible in the code completion pop-up on my Windows XP machine which is also running NetBeans 6.1 as in Tor's demo, but does not work on my Ubuntu install. Is there a setting that enables the Gems documentation to be shown? Did some research this morning using Google. I found two posts related to this by Tor on this matter in his blog: 1. Tuesday October 16, 2007 - Where he is advising to delete /var/cache as follows: his very nice autocomplete doesn't work for me (I can post screenshots if there is a way to do so). I have the latest nightly build (16/10/2007) My connection to database in the server tab is ok and active (I can browse my database from netbeans) Autocomplete does not provide interesting suggestion, like on your screenshots. Other bug I have: rdoc doesn't show up for rails function, it shows only for ruby keywords and functions. To be more precise: typing "ri validates_uniqueness_of" in a shell window will show me the doc for this rails function. But hitting ctrl+shift+space when the cursor is on "validates_uniqueness_of" in netbeans won't show anything. Maybe this is due to my gem install path: /var/lib/gems/1.8/ on a GNU/Linux ubuntu OS. Any hints about what I can do to get all thoose amazing features working for me? Or maybe there is a better place to post this problem? Posted by Sebastien on October 17, 2007 at 03:02 AM PDT # Hi Sebastien, these two issues are probably related. (Having a database connection doesn't matter, NetBeans doesn't use that for completion, it's instead inferring information from your migration files.) I'd like to get more information; I have an Ubuntu machine too and it's working for me. I'm assuming you're using $GEM_ROOT to point to your gems. The various feedback channels for bugs, ideas, etc. are listed here: http://wiki.netbeans.org/wiki/view/RubyFeedback One more thing to try in case you're on Rails 1.2.5 and had been running some other NetBeans daily builds recently is to wipe out your userdir's "var/cache/" subdirectory and restart NetBeans. 2. Friday Ocotober 26, 2007 just (a few hours ago) checked in a bunch of changes to clean up how NetBeans handles the gem load path. It should now finally handle $GEM_HOME properly, as well as vendor gems and in particular, vendor/rails. Thus, the active record completion I showed last week should now work with Rails 2 and edgerails. NetBeans should properly pick gems both from the current project as well as the current gem root (based on which gem version is higher). However, all of these changes were a bit involved... So I would really appreciate if people could grab the current bits (build 4866 or later from http://deadlock.netbeans.org/hudson/job/ruby/) and take it for a quick spin. Make sure that code completion etc. picks up your gems as before. You may have to wipe out the cached indices (userdir/var/cache/) if you have any problems. Don't worry, it's always safe to wipe out stuff inside var/cache.) If there any problems, please let me know now since we're about to freeze for 6.0. I am trying to follow Tor's advice and I deleted the contents of cache directory under my user dir and restarted NetBeans. It did not work. /home/bruparel/.netbeans/6.1/var/cache What is interesting is that this problem is only occurs in my MRI installation. It does not happen in JRuby. Consider the following migration from Tor's screencast. For the purpose of demonstration, I have typed-in 't.co' under the line t.column "tilte", :string class CreatePosts < ActiveRecord::Migration def self.up create_table :posts do |t| t.column "title", :string t.co end end def self.down drop_table :posts end end 1. The code-completion works in both MRI and JRuby. Both show the two column methods: one without any parameters and the other with the three parameters. The second column method also shows documentation in JRuby whereas it does not in MRI (for the record any other method connected to any of the Gems installed - here ActiveRecord off-course). 2. I can navigate to the column method source code for ActiveRecord if I put my cursor on the word "column" in the following line of code in JRuby but not in MRI (netbeans just beeps). t.column "title", :string Here are the Platform related parameters for both the platforms gleaned from Tools -> Platform menu: 1. MRI: Platform Name: Ruby 1.8.6 (2007-06-07 patchlevel 36) [i486-linux] Interpreter:/usr/bin/ruby1.8 Gem Home:/usr/lib/ruby/gems/1.8 Gem Path:/usr/lib/ruby/gems/1.8 Gem Tool:/usr/bin/gem (1.1.1 (1.1.1)) 2. JRUBY: Platform Name: JRuby 1.8.6 (2008-03-31 patchlevel 6360) [java] Interpreter:/home/bruparel/netbeans-6.1/ruby2/jruby-1.1/bin/jruby Gem Home:/home/bruparel/netbeans-6.1/ruby2/jruby-1.1/lib/ruby/gems/1.8 Gem Path:/home/bruparel/netbeans-6.1/ruby2/jruby-1.1/lib/ruby/gems/1.8 Gem Tool:/home/bruparel/netbeans-6.1/ruby2/jruby-1.1/bin/gem (1.0.1 (1.0.1)) Something that I may have done and might be creating a problem - I do not have a site_ruby directory under /usr/lib/ruby as I do on my Fedora laptop where the documentation is displayed correctly and I can navigate to an ActiveRecord method. Could that be creating this problem? What are my options? A complete reinstall? Thanks in advance for your time. Bharat |
|
|
Re: Documentation for Installed Gems is not appearing in the code completionI believe that I have found a bug in Netbeans 6.1. The bug is that it NEVER indexes the gems in the MRI installation IF they already exist in the default JRuby installation.
Here is how I proved it. I have three machines one running Ubuntu, another running Fedora Core 5, and lastly a Windows XP machine. I had this problem of not being able to see the documentation for the column method in the migration snippet shown below on my Ubuntu machine whereas both Fedora Core 5 and Windows machines were happily displaying it. class CreatePosts < ActiveRecord::Migration def self.up create_table :posts do |t| t.column "title", :string t.co end end Windows and Ubuntu are apples and oranges. So I decided to concentrate on my Fedora and Ubuntu machines. I had installed ruby 1.8.6 in the /usr/local directory on Fedora machine (I cannot remember why) so I decided to rebuild my Ubuntu machine and move ruby from /usr/ directory. So I reinstalled everything including ruby, rubygems, and rails building it by source compilation instead of apt-get installation. Still, the same problem persisted. Now I started looking for the differences. I turns out that I have installed Rails 2.0.2 in the MRI platform on both my Fedora and Window machine and NetBeans 6.1 also installs rails 2.0.2 by default with the JRuby platform. I had intentionally downgraded rails to MRI 1.2.6 on my Ubuntu installation to work on an older project. This deviation is enough to send Netbeans 6.1 in a downward spiral. Good thing is: it is not throwing errors if you use methods from the 1.2.6 rails, but it is not displaying documentation either. What is really interesting and proves conclusively that MRI gems are not being indexed and are not available for documentation viewing and source navigation is that when I right click on the t.column method to display its source, the shcema_definitions.rb file from JRuby activerecord gem is being displayed and not from the MRI side. Since they are identical for both MRI and JRuby (2.0.2), the fact that Netbeans gives priority to JRuby gems is a mute issue. This behavior is common on both my Fedora and Window machines. But if the rails versions are not the same in JRuby (2.0.2) and MRI (1.2.6), NetBeans 6.1 gives up and does not display the documentation for any of the gems, and the navigation to the desired source method (here t.column in the activerecord migration) also fails. If any Netbeans developer on the development team can confirm this, I will really appreciate it. This is unfinished business. Thanks. Bharat |
|
|
Re: Documentation for Installed Gems is not appearing in the code completionCase closed. Dev team, please verify and let me know where to file the bug report.
I downgraded my NetBeans install from 6.1 to 6.0.1 which has rails 1.2.5 (close enough to my MRI rails 1.2.6 install). Code completion, rails code browsing, documentation display in pop-up works correctly as before. I loose a lot of goodies in Netbeans 6.1, but this is for an older project still on 1.2.6, so that is OK. Moral of the story, if you have to work with an older version of rails in your MRI install rather than the default Netbeans 6.1 JRuby 2.0.2 (which can be upgraded to 2.1), you should stay away from 6.1. Netbeans 6.1 works well (though incorrectly giving preference to JRuby ruby installation even if you choose MRI platform for your project) when both JRuby and MRI rails installations have matching versions. This is true regardless of the platform, i.e., Window and/or linux, or the distro of linux (Ubuntu/Fedora). I will be very happy if one of the developers proves me wrong. Bharat |
|
|
Re: Documentation for Installed Gems is not appearing in the code completionHi Bharat,
I lot a little bit lost in this thread. Can you describe a set of steps for me to reproduce the problem with current bits? -- Tor On Jun 27, 2008, at 8:24 AM, bruparel wrote: > > Case closed. Dev team, please verify and let me know where to file > the bug > report. > I downgraded my NetBeans install from 6.1 to 6.0.1 which has rails > 1.2.5 > (close enough to my MRI rails 1.2.6 install). Code completion, > rails code > browsing, documentation display in pop-up works correctly as > before. I > loose a lot of goodies in Netbeans 6.1, but this is for an older > project > still on 1.2.6, so that is OK. > > Moral of the story, if you have to work with an older version of > rails in > your MRI install rather than the default Netbeans 6.1 JRuby 2.0.2 > (which can > be upgraded to 2.1), you should stay away from 6.1. Netbeans 6.1 > works well > (though incorrectly giving preference to JRuby ruby installation > even if you > choose MRI platform for your project) when both JRuby and MRI rails > installations have matching versions. > > This is true regardless of the platform, i.e., Window and/or linux, > or the > distro of linux (Ubuntu/Fedora). > > I will be very happy if one of the developers proves me wrong. > > Bharat > -- > View this message in context: http://www.nabble.com/Documentation-for-Installed-Gems-is-not-appearing-in-the-code-completion-tp18040380p18157590.html > Sent from the NetBeans Ruby - Users mailing list archive at > Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@... > For additional commands, e-mail: users-help@... > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Documentation for Installed Gems is not appearing in the code completionI will try:
We will use your RubyWebLog application as a vehicle. Please install Native Ruby (here-on referred to as MRI). The exact version of Ruby does not matter (I have 1.8.6 p 111 on all my three machines) but the Rails version does. Please use Rails 2.0.2 as I have not tested this condition in Rails 2.1 yet. NetBeans final 6.1 comes with JRuby 1.1.1 which has Rails 2.0.2. Switch to MRI platform for your RubyWebLog demo (you can do it before creating this application or switch the platform from JRuby to MRI afterwards, does not matter) Open RubyWebLog/Database Migrations/Migrate/001_create_posts.rb. On my Ubuntu machine, it is as follows: class CreatePosts < ActiveRecord::Migration def self.up create_table :posts do |t| t.column "title", :string end end def self.down drop_table :posts end end Position your cursor on the line that has t.column on the word "column". Press Ctrl-Space. You should see a pop-up displaying two methods 1. columns and 2. column with name, type, options parameters. Since we are using the second method here, select it. You should see the documentation below the the method declaration. On my machine it reads as "Instantiates a new column for the table. The type ...". This documentation is what I am after - I find it immensely useful in reading the code especially the code written by someone else. Now downgrade your MRI Rails installation to 1.2.x (I used 1.2.6 since I am working with an older 1.2.6 application that has not been upgraded to 2.0.2 yet.). Make sure your RubyWebLog application still points to the MRI platform and repeat the process above, i.e., display the migrations file for posts, position your cursor on the columns method and try to display the method documentation. You will see that the documentation for the column method is not available. In a nutshell, that is the problem. I believe that it is happening because NetBeans 6.1 fails to index the Ruby Gems (in our case Rails related gems) on the MRI platform if they are common on both JRuby and MRI platforms. Further, Netbeans 6.1 will display the sources from the JRuby side only. As a matter of fact, when you have different versions of Rails as we have here in JRuby (2.0.2) and MRI (1.2.6) and your application is using MRI platform, Netbeans 6.1 refuses to display sources from the MRI side even though your application is configured to use the MRI platform. Let me know if you can or cannot reproduce the bug. Regards, Bharat |
|
|
Re: Documentation for Installed Gems is not appearing in the code completionOn Jun 28, 2008, at 7:32 AM, bruparel wrote:
> class CreatePosts < ActiveRecord::Migration > def self.up > create_table :posts do |t| > t.column "title", :string > end > end > > def self.down > drop_table :posts > end > end > > Position your cursor on the line that has t.column on the word > "column". > Press Ctrl-Space. You should see a pop-up displaying two methods 1. > columns > and 2. columns with name, type, options parameters. Since we are > using the Note - I just checked this, and code completion in this scenario was broken. I tracked it down and discovered that the type analyzer was getting confused about a new parse tree node added in JRuby 1.1.3 (which we recently switched to). This meant that it thought the type of "t" was "nil", so it offers code completion on NilClass instead of the active record table class. I've just fixed this (changeset 6ca8a6c0f254). Since your bug report predates this, your original problem may still be there, but I thought I'd bring this up if you or anyone else has seen similar problems. -- Tor --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Documentation for Installed Gems is not appearing in the code completionThanks for tracking it down Tor. I appreciate it.
I am working on a fair size Rails project and am constantly using NetBeans 6.1. Is NetBeans 6.5 stable enough now? I am concerned about loosing unproductive time if there are major bugs. Is there a place that lists Ruby and Rails specific enhancements in Netbeans 6.5? Regards, Bharat |
|
|
Re: Documentation for Installed Gems is not appearing in the code completionOn Jul 26, 2008, at 1:55 PM, bruparel wrote:
> > Thanks for tracking it down Tor. I appreciate it. > I am working on a fair size Rails project and am constantly using > NetBeans > 6.1. Is NetBeans 6.5 stable enough now? I am concerned about loosing > unproductive time if there are major bugs. Is there a place that > lists Ruby > and Rails specific enhancements in Netbeans 6.5? You can install both versions side by side and switch back and forth. The two versions will use different user directories with their settings, so they shouldn't trample on each other. If you're looking for a semi stable release, perhaps you should wait for 6.5 Milestone 2. We have 6.5 milestone 1 already but it's getting a bit old I think You can see the changes in 6.5 here: http://wiki.netbeans.org/RubyRecentChanges The changes from somewhere in April and up are new to 6.5. An alternative list including stuff up to Milestone 1 is here: http://wiki.netbeans.org/NewAndNoteWorthyMilestone1NB65#section-NewAndNoteWorthyMilestone1NB65-Ruby -- Tor -- Tor --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
| Free Forum Powered by Nabble | Forum Help |