Tuesday February 27, 2007
Tim Bray just posted an entry on his first experiments with the Ruby and NetBeans support and in particular, talks about the syntax highlighting. I was already planning on spending this week's screenshot on the highlighting features, so I'll use Tim's ape.rb source code and show you a few more details:
Notice the following:
dummy which I inserted to make a point - that's not Tim's fault!).
"\n" is not expected as an escape code - this is a single quoted String after all.
#{ } - is properly shown as Ruby code. Occurrences highlighting and code completion works in these sections too.
In doing this screenshot I noticed a couple of bugs I'm off to fix now!
(2007-02-27 14:02:59.0) Permalink Comments [9]
Tuesday February 20, 2007 If you try code completion on any complicated arbitrary expression, it will show you a number of possible method completions along with the corresponding class. This gives you much the same information as ri:
However, in many contexts, we know the exact type. For example, if you type File. and invoke code completion, NetBeans will show you only the singleton methods of class File (as well as inherited methods and module mixins):
In some cases, we know more than just the class - we know that we're dealing with an instance of that object. In that case we can show all the instance methods too - not just the class methods:
Here's we're applying code completion on a regular expression literal.
This works for all kinds of literals in your code - Strings, regular expressions (shown above), arrays (try [1,2,3].e to see the each method and its documentation for example), hashes, symbols, numbers, ... you can even try it on the "nil" keyword!
Friday February 02, 2007
Yes, the code is now in CVS. Please note that this is under active development. There are known bugs and instability. This is for early adopters only! As things get more stable we'll be making more official builds for a broader audience. I'll post a feature list here soon so you know what you can play with.
Did I mention that this may be unstable? Okay, good. I've posted screenshots here before, but remember that screenshots will show a particular case known to work, not a feature working in all conditions... Don't rush into this with high expectations. I will however be doing my best to fix bugs and add features. Please file bugs with Issuezilla in the scripting category with ruby as a sub category. Join the mailing lists to provide feedback and participate.
Did I mention that this is for early-adopter types only at this stage? Okay, good.
If you felt cheated by the above screenshot, here's another one. Can't remember the escapes in a Regular Expression? No problem!
This is not particular to regular expressions. Try it on dollar variables, or in literal strings. Here's another example: