Saturday, July 26, 2008

Screenshot of the Week #31: Python, Groovy

WARNING: This blog entry was imported from my old blog on (which used different blogging software), so formatting and links may not be correct.

In my language support blog entry last week I talked briefly about the PHP, Python and Scala work going into 6.5. That's not an exclusive list. We're also adding Groovy support, and it's making great progress. Martin Adamek is posting status updates on his blog; here's Groovy instant rename in action:

The Python work is making good progress too. Here's code completion now for methods and classes, with integrated documentation support:

Here's another screenshot: Python quickfixes:

Anyway, I'm going on "vacation" now for a few weeks. I put that in quotes because I'm moving, and honestly, packing, cleaning and moving is hard work. Coding, now that's fun. I can't wait for my real vacation to start when I get back to work.

Tuesday, July 15, 2008

Multilingual NetBeans: PHP, Python, Scala

WARNING: This blog entry was imported from my old blog on (which used different blogging software), so formatting and links may not be correct.

I've mostly been writing about Ruby and JavaScript on this blog, but NetBeans is getting strong language support in other languages as well!

First, take a look at the PHP support. Petr Pisl, Tomas Slota, Radek Matous, Tomas Mysik and others have been posting screenshots and
feature descriptions regularly on their team NetBeans PHP blog. Check it out - code completion,
quick fixes, semantic highlighting - we're going to have a fantastic PHP IDE! Here's a screenshot - look at the unused method detection for example:

The Python support is starting to shape up too - here's a screenshot of code folding, semantic highlighting and instant rename refactoring.

Coming soon - code completion and other editing goodies.

And I just now noticed a post from Caoyuan Deng
that his Scala support for NetBeans is now built on top of the native scala compiler. His editing support is already feature packed (take a look at his blog for some of the past entries) and now that he has 100% language parity things are looking very very good!

Last but not least: InfoWorld has reviewed 9 Ruby IDEs,
and NetBeans came out on top!

Sunday, July 6, 2008

Ruby Screenshot of the Week #30: New YAML Editor

WARNING: This blog entry was imported from my old blog on (which used different blogging software), so formatting and links may not be correct.

As part of our Ruby and Rails support, we've had a YAML editor in NetBeans for a couple of releases now. However, the support was primitive. Only the most basic editing features were there, and more problematically, many common, valid YAML constructs were not supported. You'd get various wrong error messages from the parser if you tried to go outside the normal simple syntax of the database.yml file in Rails.

In the latest dev builds however, there's a brand new implementation of a YAML editor. Let's start with a screenshot:

There are several things going on here. First, note that the editor now understands more complicated YAML constructs - such as the << key mapping merge operator. In this file, we've shared the definition of the "createdon" attribute. And in the navigator, as we drill down you can see this attribute showing up properly inlined in both places the reference was used.

Notice also how we have embedded Ruby code here (the green fragment inside <% %>). This is pretty important for another Rails usage of YAML: Fixtures. Just like in ERb/RHTML files, the YAML Ruby embedding support should be complete; quickfixes should work, go to declaration, smart indent and formatting, and so on - including code completion:

Finally, if you're a bit rusty on YAML and can't remember all the various escapes to do collections, aliases, documents, tags and so on, you can invoke normal code completion to see the various special characters - along with the YAML quick reference document in the documentation popup:

There are a few other things in there as well; AST based selection (Command-Shift-Dot or Comma), slightly better smart indent, and so on. One thing which is still missing is code folding. I disabled it since there were a few issues with it still.

I have to pause here and add a big Thank You to Ola Bini from the JRuby team! A few weeks ago, yet another bug report was filed by somebody complaining about a false error in the YAML support, and I decided to look into rewriting it from scratch using the same editor infrastructure that we have for Ruby, JavaScript, etc. The first thing I would need however is a YAML parser. I know JRuby had a good one, so I tried using it - but realized I would need to customize it a bit for IDE purposes. For example, I would need AST offset information. I thought of ways I could subclass parts of the YAML parser to achieve this, and I sent an e-mail to Ola asking if he thought this was feasible. I immediately got a response - and not only did he say it was possible, he offered to personally do it, by adding proper offset support into the parser. And just a couple of days later he released a new version of the parser with full offset support. It worked perfectly. With the parser in hand, implementing the above editing functionality was easy. So a lot of the credit for the new editor goes to Ola. Thank you!

As always with new functionality, please take it for a spin and report back any issues you find (using the normal feedback channels). NOTE - you do need the latest dev builds for this - even 6.5 Milestone 1 is too old. Some of this was checked in today so won't even be in the current nightly build (depending on when you read this).