"Creator" on this page refers to Sun Java Studio Creator.
Wednesday July 18, 2007
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!
(2007-07-18 12:44:07.0)
Permalink
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 12:33 PM PDT #
Posted by hemant kumar on July 19, 2007 at 12:33 PM PDT #
HTML
- 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
RUBY
- Insert ERBs <% %> or <%= %>
Tks
Greg
Posted by GregH on July 22, 2007 at 04:39 AM PDT #
* 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?
thanks
Posted by GregH on July 25, 2007 at 03:58 AM PDT #
Posted by bill kress on July 25, 2007 at 11: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 11:59 AM PDT #
Posted by John on August 01, 2007 at 11: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 12:02 PM PDT #
Posted by John on August 03, 2007 at 08:56 PM PDT #