Java Virtal Machine.net

[ News ] rss

July 13, 2007

Enterprise Systems: The New Bounce in Sun’s Step. Don’t look now, but Sun Microsystems Inc. has a new bounce in its step. From its recent...

More »

June 24, 2007

Jazoon'07. Jazoon'07 brings together experts and users of Java and open source technologies from all...

More »

April/2007
SunMonTueWedThuFriSat
1234567
891011121314
15161718192021
22232425262728
2930     

[ Archives News ]

home > news > developers > ruby screenshot of the week #10: taking up the gauntlet

Ruby Screenshot of the Week #10: Taking Up The Gauntlet

SapphireSteel, makers of the Ruby In Steel plugin for Microsoft Visual Studio, has been touting their own code completion feature for a while. One thing which has irked me a bit is that they tend to dismiss "code completion" as inferior to "true IntelliSense" - as if code completion is the name for simple identifier matching. Just to be clear - IntelliSense is a trademark of Microsoft, so nobody else calls the same feature that. Borland has referred to it as CodeInsight, but most IDEs refer to this feature as code completion. In this article, SapphireSteel is throwing down the gauntlet by encouraging their users to see if anyone else can produce results like theirs: To the best of our knowledge, Ruby In Steel’s IntelliSense for Ruby is unrivalled by any other IDE. {...} We’ve also supplied a few files from our IntelliSense test suite which we invite you to use with Ruby In Steel and any other editor or IDE of your choice. So, I thought I would show what code completion in NetBeans is capable of. Let's start with test 1, which calls for code completion on an array literal in the source: As you can see, we show the type of methods right in the code completion dialog. It doesn't matter much for an Array, but if you had invoked code completion on the numbers themselves, you'd see that some methods are coming from Integer, and some are coming from its parent class Numeric - and sometimes it's interesting to know that. Next, let's look at test 2: The above example shows the type analyzer tracking types of variables. More interestingly, notice that while we show the methods on the class "above the line", there are other methods there too. Those are methods inherited into MyClass. In the SapphireSteel screenshots, these methods were turned off, presumably because in Visual Studio they would be interleaved with the regular methods. The evaluation document describes how you can turn Object inheritance on and off in the options. I think our solution is nicer because you get the best of both worlds: the methods you are likely most interested in appear first, but when you ned the "standard" methods (they are there for a reason, after all), they also appear. Thus, if you have a String object and you're completing on the letter "e", you see "empty?" (a String method), but also "eval" (an Object method). Next, test 3 which tests module mixins: Looks fine - and so does test 4 which is a more complicated scope test: Anyway, I don't want to imply that our code completion is perfect! I still have a lot of things I want to do in our type inference engine. In particular, I want to make sure that code completion works well where it really matters: In code you're writing. Here's a final screenshot from a Rails application where you're writing a controller. Code completion works on important methods like render, or a method I found myself calling the other day - send_file: Rails does a number of things that are very tricky to handle for the IDE, so I'll be spending more time in this area to improve code completion for Rails apps. P.S. To try it yourself, get bits from nbextras.org. As of yesterday we're in Milestone 9 stabilization, so a promoted build should be available within the next couple of weeks.


Date: April 20, 2007
Category: Developers

More »


Others News

©2002-2008Java-Virtual-Machine.net :Java Archive: :Solve Crosswords de fr ru pt es it: :Free PC Download: :Micrometer: