Ruby Screenshot of the Week #27: Task List

I've posted a number of blog entries showing NetBeans quickfixes for Ruby. This helps you detect problems in code you happen to be working on, since it shows a yellow rather than green file status if there are warnings in the file. (The file status is shown on the right hand side of the editor pane, next to the vertical scrollbar).

Unfortunately, this doesn't give you an easy way to audit your code. If you want to find all potential problems in your code, you'd have to open each and every file and look for yellow editor annotations... Not a tempting task for projects with hundreds of source files.

No more. As of the latest NetBeans 6.1 development builds, the Ruby hints and quickfix functionality is integrated with the tasklist. All you need to do is open the tasklist window (Ctrl/Command-6 - the number, not F6, or find it in the Windows menu). The tasklist will scan the entire project - or indeed all open projects - or even just the currently edited file. The tasklist scope can be chosen by the toggle buttons on the left hand side of the window.

When you're working your way through the results, note that the tasklist responds to the Navigate | Next Error action (default bound to Ctrl/Command-Period). This will also warp the caret right to the editor location for the error, which means you can press Alt-Enter immediately to show the rule quickfixes, if any. One such quickfix is to disable a particular hint type, so if you don't like a particular warning you can suppress it by just turning off the rule.

I personally don't like the Output window occupying the entire IDE width. Luckily configuring the window layout is very easy - just drag the windows around to where you want them. In my preferred configuration, I drag the output-windows into the editor bottom such that you end up with a layout like this:

Note also that the tasklist isn't only hooked up to the quickfixes; it's hooked up to the error functionality too and any parsing errors in your project will be listed there, at the top of the list (since errors have a higher priority than hints and warnings).

Although you can disable hints as I've described above, you cannot turn off compiler warnings yet (such as the one about ambiguous parameters).

Anyway, I hope this will be helpful. Even if you're not a NetBeans user, perhaps you can try a quick audit of your source code with it. Get a 6.1 dev build here, open the IDE, choose "New Project", and then choose either a Ruby or a Rails project with existing sources. Point to your sources, hit Finish, and then open the tasklist and let it churn away. Send bug reports and other feedback here.


Amazing!!! No more to say

Posted by ruby.freeman on January 19, 2008 at 09:53 AM PST #

Very cool. Does this display comments written with a starting TODO or not?

Posted by Shadowfiend on January 22, 2008 at 12:22 AM PST #

One thing that would be great to have is the possiblty to navigate the routes (rake routes) and ctrl/command click the function name in views or controllers, example club_user_path(..) and this should then take me to the controller user, index action.

Posted by Jon Stenqvist on January 22, 2008 at 05:11 AM PST #

This advances!.
Netbeans + JRuby + ... do you know Swiby?
It might be a perfect combination. ;-)

Posted by Juan on January 23, 2008 at 04:38 AM PST #

Hi Tor,

thanks for your great work. I'm sorry to highlight this but I'm having HUGE usability issues with Netbeans due to that bug apparently:

If it were only me, that would be fine. But I fear a bunch of users might actually be having the bug. If it were the case that would be ruining all you great Ruby efforts cause for me it's not even usable. So I just wanted to highlight that in case you at Sun might not see the true damage of such a bug. I'm saying to lot of people to take a look at JRuby and that's there is even an IDE. But I'm fearing they try, see that bug and then laugh at Netbeans unfortunately...

In any case thanks for your great work. I just hope to be able to jump back on Netbeans if you get it fix.

Posted by guest on January 24, 2008 at 06:05 AM PST #

Hi! I've been using NetBeans for a long time, and never meet this bug. More to say, I use compiz-fusion, and everything works just great. So may be the problem with old Java version or with operation system? (I use Mandriva, and Java 1.6.0_10-ea)

Posted by ruby.freeman on January 24, 2008 at 06:59 AM PST #

Hi Tor!! In the Navigator there is a filter - "Show Class Methods and Variables". It would be great to add there "Show Instance Methods and Variables" - because sometimes it's usefull to see only Class Methods without Instance Methods. Thanks!

Posted by ruby.freeman on January 24, 2008 at 02:39 PM PST #

Hi Shadowfiend,
yes, the tasklist already does TODO scanning. The set of patterns it scans for are configurable under options, but TODO, FIXME, PENDING, XXX and <<<<<< are included by default.

thanks for the idea. Would you mind expanding a little bit on it and either posting it as an enhancement request or sending it to one of the Ruby feedback aliases listed in ?

thanks for the pointer to Swiby. Yes, there are a lot of frameworks other than Rails for Ruby that we ought to look into - HAML, Merb, ... The requests are pouring in. If only we had more time...

Hi anonymous,
I'm sorry about the usability issue you're running into with issue 119617. I've hit it myself. It's been with us for quite a while, and the reason it's hard for us to fix is that it's really a bug in the JVM on OSX. We have a lot of workarounds in NetBeans for OSX JVM issues, so personally I can't wait for JDK 6, hoping it will be better. But actually, since I switched to Leopard I haven't encountered this bug. But if it does happen, one workaround that usually works is to bring up some other dialog which has an embedded textfield. That restores focus. In other words, when the caret is lost in the editor, go to the Edit menu, select the Replace action, and click in the textfield. Dismiss the dialog. You now have the caret back. Yes, it's really annoying but better than restarting - and for me, this only happened ocasionally on Tiger. Recently, a lot more engineers on the NetBeans team have gotten Macs, so there's a greater chance that we'll find a workaround for this problem. But personally, this bug is the biggest reason I'm looking forward to an updated JVM from Apple - not the JDK 6 features.

Freeman, thanks for the idea!

Posted by Tor Norbye on January 24, 2008 at 05:07 PM PST #

Awesome. Thanks!

Posted by Shadowfiend on January 24, 2008 at 10:29 PM PST #

Tanks Tor. :-)
Swiby is not a web framework. It is like JavaFX, but in Ruby language.

Posted by Juan on January 25, 2008 at 07:40 AM PST #

Tor and ruby.freeman,

Thanks for your answers. However, contrary to what you believed, I'm not using Mac OSX neither an old JVM. No, I'm on a very up to date Ubuntu Linux with Java version 1.6.0_10-ea-b09. (I tried several anterior versions too). Once more I just tried to remove all my .netbeans\*, .nbi\* and .rubyide\* files and re-install rubyide netbeans 6.0. I soon got the same bug. Seems like first time it happens was after the first time I had some kind of auto-completion popup. Then the caret was disabled and the bug appeared again when re-openning the file. This is roughly what issue #119617 described. I also believe not only Mac OSX users reported it. I used the Ruby native interpreter as the Ruby engine. I also believed I had the trouble also editing standard Java files while running the full IDE. So this might be more serious that you may think. Or may be it's only my computer, but that would be the first time I run into such a specific issue. Any idea?

Posted by Raphaël Valyi on January 25, 2008 at 11:34 PM PST #

Hi Raphaël Valyi! Just for experiment, you can dowload and try my (already configured) version of deadlock NetBeans -
the folder .nbrubyide from the archive should be put into the home directory
and the symlink from nbrubyide/ruby1/jruby-1.0.3/bin/jruby should point to
your ruby (I've deleted jruby to be sure that the problem is not about it)

Posted by ruby.freeman on January 26, 2008 at 07:42 AM PST #

ruby.freeman, YOU ROCKS! Thank you so much, seems like your dev version almost doesn't show that bug anymore. I tried it a lot and had it only once. It was after a CTRL+G + line number, then carret was disabled. When I re-oppened the file the bug was gone (with NB 6.0 I had to re-oppen the file twice for it to go away). Next times I tried CTRL+G, I didn't see it again. So I think you are almost there. At least I find it really usable again and would say it's faster (that was needed). I tried it with JRuby head as the ruby runtime. If you want me to try later versions to ensure it doesn't lock, you can mail me at (without the - of course). Hope you make it soon. Also may be it would be better to communicate around this issue if lot's of people have it because otherwise I fear people having the bug might not take Nebteans seriously (like: how can Sun miss that one?).

Posted by Raphaël Valyi on January 27, 2008 at 07:12 AM PST #

Hey Tor, I just noticed that you responded to my comment on the previous blog post (comments are now closed). I just wanted to say that I checked out the latest netbeans build after that. You're awesome... now I can stop using beta2. Many thanks my man. :)

Posted by Aph on January 29, 2008 at 07:35 AM PST #

Hi Aph, glad to hear it! Note that I also checked in another fix yesterday which finally makes pressing return in HTML sections in an RHTML file no longer go to column 0 but should mostly do the right thing - so be sure to get the latest build. (We just announced Milestone 1 of NetBeans 6.1 today, but both of these fixes were integrated later than the codefreeze for that, so this will go out in Milestone 2).

Posted by Tor Norbye on January 29, 2008 at 07:40 AM PST #

Hi Raphael and Freeman,
Can you tell me what you changed in your configured version of rubyide - are there any specific vm flags you're using that makes Ubuntu happier?

Posted by Tor Norbye on January 29, 2008 at 07:42 AM PST #

Hi Tor! I just changed the default_options in the nbrubyide.conf to
this line
default_options="-J-Xms64m -J-Xmx512m -J-XX:PermSize=64m -J-XX:MaxPermSize=512m -J-Xverify:none -J-Dswing.aatext=true --fontsize
and also configured a little bit look-n-feel (changed some fonts, hided some
unusable panels, etc.)

Posted by ruby.freeman on January 29, 2008 at 07:49 AM PST #

Will do Tor. Just wanted to say thanks again. That bug was the only thing keeping me from upgrading off of 6.0beta2. I'm excited. \^_\^

Posted by Aph on January 29, 2008 at 09:35 PM PST #

hi Tor! There is no changes in for the last 4 days.. something happens?

Posted by ruby.freeman on January 30, 2008 at 07:24 AM PST #

Yes - see

Martin is looking into it.

Posted by Tor Norbye on January 30, 2008 at 08:56 AM PST #

I haven't been using 6.1 so I followed the link for the nightly build and got last nights build. In 6.0 under tools>options>ruby I can select the ruby interpreter. Was this removed in 6.1? I can't seem to find where to choose my interpreter, I need to change it. Thanks.

Posted by paul on February 06, 2008 at 09:25 PM PST #

Hi Paul,
this is one of the areas which have hopefully improved a lot in 6.1. Go to Tools | Ruby Platforms. After configuring a platform you also need to tell each project which platform you want to use (via the project's Properties panel). When you create new projects etc. it asks you which platform you want to use.

Posted by Tor Norbye on February 07, 2008 at 12:13 AM PST #

Thank you for the response Tor. One more quick question. In 6.0 I was using webrick, so I reninstalled mongrel and the ide started using that by default. In 6.1 it is using webrick, can I change this to use mongrel and change the environement from development to production? I had posted something in past about this on the nabble board and it seemed like it was intended for the future. Thanks again for the help and a great product.

Posted by paul on February 07, 2008 at 02:43 AM PST #

forget my last comment, I found it. Wow, I need more coffee.

Posted by paul on February 07, 2008 at 02:44 AM PST #

Post a Comment:
Comments are closed for this entry.

Tor Norbye


« October 2016