Jump In - The Water's Warm!

My previous blog entry discussed the new Quick Fix feature for Ruby in NetBeans.
Today, I'd like to invite you all to jump in and add your own quick fixes!
Nothing (with some notable exceptions...) could be more fun! Writing a quickfix is easy, fairly self-contained (so it's easy to get started), and the resulting feature has high user visibility and utility. Thus, I think it's a great way to join an open source project and have some fun. Besides, working on tools is extra rewarding since at the end of the day, as a programmer you get to use the stuff you're building in your day-to-day work!

I've written a bunch of "Getting Started" documentation for how to write your own hints. The main starting point is is the How to Write a Hint document, which tells you everything you need to know. Look it over and see if you get inspired! If so, follow these steps:

Even if you don't want to code on the project, I'd love to have your active mailing list participation. Please join the mailinglists (or read it with a newsreader or web interface). Also feel free to edit the wiki pages and add your own quickfix requests.

I hope to see some of you on dev@ruby.netbeans.org soon!

Here are some hint ideas to get you started (a more up to date list is in the hint-howto wiki page):

  • Offer to replace a { } block with a do-end and vice versa (unless it's a single-line block where braces are most common)
  • Look for typos: incorrect spelling of "initialize", or perhaps an assignment to a variable that is close in spelling to another symbol
  • Offer to add parentheses to a code construct where the lack of parentheses results in ambiguity (such as nested method calls without parentheses)
  • Offer to remove parentheses where that's okay (some developers prefer not to use them)
  • Offer non-Railsy deprecations: Use fileutils instead of ftools, cgi instead of cgi-lib, avoid importenv, ... Anything else?
  • Offer to remove unused variables (the left hand side of the assignment, or if the right hand side is known not to
    have side effects, the entire statement)
  • Style warnings: Using method names containing uppercase/camelcase names, or constants containing lowercase characters
    • Camelcase warnings should perhaps not kick in for projects enabled for Java API calls (e.g. with JRuby)
  • Offer to fix various code style violations - see one example style guide,
    here's another, and yet another
  • Split multiple statements on a line into separate lines (I have this for defs and classes but x=y; foo should be splittable.)
  • (JRuby projects) For an unknown class, check the Java index and offer to "import" the Java class into the Ruby name space
  • Tell us your own ideas!


Hemant, sorry to hear you're having problems. An IDE freeze sounds like a separate problem from the IDE being slow. For that, can you file a bug and (this is the important part) attach a thread dump which shows why the IDE is frozen? Info on how to generate a thread dump is at http://wiki.netbeans.org/wiki/view/GenerateThreadDump.

There are no open bugs (as far as I know) on the IDE freezing so a thread dump will be invaluable. A URL to file a bug on the right categor etc. is listed in http://wiki.netbeans.org/wiki/view/RubyFeedback.

I'm sorry the Schliemann editor bugs are still there - but I don't work on Schliemann so I can't do anything about them myself. However, the main developer just returned from vacation so I think he'll be looking at them now.

Posted by Tor Norbye on July 19, 2007 at 05:33 AM PDT #

Tor, perhaps you do not yet realize how much netbeans is slow with real large projects. Quite often IDE freezes and must be killed. Those bugs with schillmen's editor still exist. I tried latest build and IDE froze couple of times and hence went back to older release. What I would really like is to have those bugs fixed. But anyways....

Posted by hemant kumar on July 19, 2007 at 05:33 AM PDT #

Hi Tor - can you comment on whether there is a way to achieve the following textmate bundles (not sure if I'm missing them or they were some of the harder to implement):

- Wrap selection in open/close tag (i.e. wraps selection and then highlights the first tag, when you type in the tag value the closing tag is auto-matched to this)
- Wrap each selected line in open/close tag

- Insert ERBs <% %> or <%= %>


Posted by GregH on July 21, 2007 at 09:39 PM PDT #

Tor - I've just move from the full NB M10 download to the "#netbeans-rubyide-hudson-macosx-3105.zip" download from "http://deadlock.netbeans.org/hudson/job/ruby/".
\* I assume I can now delete the NBM10 install then?
\* Do updates to the rubyide zip files install over the top of each other, i.e. do I need to do any special clean up each time I download a new zip?
\* If I have specific GEM installation in my normal Ruby installation area (e.g. RMagick which took a bit to get working) am I best just to point NB off to this area (c.f. trying to get such GEMS installed in the JRuby area, and potentially having to do this multiple times for each rubyide zip file update)? What are the pro's/con's of using the NB JRuby installation versus the normal Ruby installation?

Posted by GregH on July 24, 2007 at 08:58 PM PDT #

I've had a couple lockups in NB10, the most repeatable is a ruby addition. If you use the ruby comment function to add 3 or 4 levels of comments, then try the uncomment to remove them--you will almost certainly lock up your entire IDE. Might be exclusive to Linux, but I've seen it happen on 4 different linux (Ubuntu) boxes across the last two versions of Netbeans (Actually, I've never added multiple level of comments without it locking) The comment/uncomment functionality in NB is also annoying, I don't really understand why it's not a toggle as it is with Eclipse, Textmate, etc. But that may not be something you have control over. Oh, and might I suggest that :<tab> bind to: {Key} => {value} I can't seem to get NetBeans to allow me to use ":" as a template trigger. Finally (as long as we're here), Selenium tests are not recognized as ruby source. Thanks for the work you do! Bill

Posted by bill kress on July 25, 2007 at 04:44 AM PDT #

Greg, in RHTML files try typing "r" followed by Tab to insert <% %> (r for Ruby) and "re" followed by Tab for <%= %> (for Ruby expression. I'm not sure exactly how the HTML abbreviations would work - can you file a request with some more specifics?

Regarding the Ruby IDE: Yes, you can delete M10, there's no overlap in the files they use. Unzipping on top of existing directories should work in most cases (it could leave some older files around) but I think it would be better if you would just keep the older build around (in case something is broken with the latest build you just grabbed). E.g. rename your old nbrubyide folder to say nbrubyide-old, then unzip the latest and run it - and revert back in those hopefully rare cases where something you depend on isn't working.

You can definitely switch your Ruby interpreter over to native Ruby and its own gems if you should want to. JRuby is bundled for convenience (and is used internally for semantic analysis) but if your code runs better on native Ruby (for example because it depends on gems using native code, such as mongrel or rmagic) you'll need to switch, and even for "interactive use" ruby is a bit faster for running the generator repeatedly etc. (since it has shorter startup time).

Bill, The lockups related to uncommenting with M10 is known; it's a bug (issue (108813) which was fixed a couple of days ago. The latest hudson builds have the fix - see http://deadlock.netbeans.org/hudson/job/ruby/. Ditto for the comment functionality: I've switched it to toggle comments (on Comand-slash) yesterday or the day before. I've had the same problem with ":" as a tab trigger; it's a limitation of the editor's code templates but hopefully well be able to address it. Regarding Selenium tests - what file extensions are these files using? It should be trivial to fix the mime resolver to recognize them.

Posted by Tor Norbye on July 25, 2007 at 04:59 AM PDT #

Hi Tor, where can we find a cheat sheet for NetBeans that tells us the keyboard binding shortcuts, etc? Also, DRYML with Hobo is being updated pretty dramatically and was curious how easy it would be to get those updates integrated.

Posted by John on August 01, 2007 at 04:55 AM PDT #

The most useful keyboard shortcuts are listed here: http://wiki.netbeans.org/wiki/view/RubyShortcuts.

I'm not familiar with DRYML and Hobo, but feel free to file requests or write to dev@ruby.netbeans.org explaining what it is you're after.

Posted by Tor Norbye on August 01, 2007 at 05:02 AM PDT #

Thanks Tor. I've been torn between Aptana and NetBeans lately. It seems that I can't find anyone that is very experienced in either one to really give a blow by blow comparison and really let us know how they fair in a fight at the moment, especially with the most recent Aptana update. HOWEVER, I thought that you'd perhaps like to review this review and also see the comments. I think that the last comment about grouping files by user choice has some merit that might need to be addressed by the NB team: http://www.mslater.com/2007/7/3/goodbye-aptana-hello-netbeans Do you know of any new/up-to-date reviews that I'm missing? Also with Leopard coming from Apple, it seems that TextMate might end up being back on top for Rails developer choice as there is a lot of hush hush work going on behind the scenes by Allan.

Posted by John on August 03, 2007 at 01:56 PM PDT #

Post a Comment:
Comments are closed for this entry.

Tor Norbye


« July 2016