Ruby Screenshot of the Week

If you've listened to the latest Java Posse episode (#99, around 56 minutes into the podcast) you heard me getting caught red handed, coding in the background while we were recording. Joe pressed me to state exactly what I was working on: Code completion within Ruby require and load statements in NetBeans. Here's a screenshot:

This will hopefully be available soon...

Comments:

Tor, this looks really nice. I'm interested in two things: First, will that code completion change depending on if you've used require_gem/gem before that place, and if you have a require 'rubygems' or not? Secondly, how much of the internals for these things depend on NetBeans libraries being available? I would sort of like having these features for Emacs... =)

Posted by Ola Bini on January 11, 2007 at 06:28 AM PST #

Meh. Ruby is so 2006. All the cool kids are getting groovy in 2007. ;)

Posted by Danno on January 11, 2007 at 09:03 AM PST #

Hi Ola (sorry about the delay). First, no, code completion is currently not looking at previous require statements to eliminate possibilities. Unlike HTML where it is an error to repeat an attribute twice, Ruby is supposed to track these things and only load things it hasn't seen before - so I didn't think this was a very important feature. Having said that, it's obviously something that's possible and probably not very hard to do. I already want to do some computations on the require-graph to limit the requires you see, since you typically get lots of irb ones or activerecord ones, where you probably should only see the "important" (root) ones that include others. Recording the second question: well, there's a lot of infrastructure here, but if you're only talking about the database part, that should be easy to query from other tools. Of course, there's also a lot of logic for keeping the indices in sync as you're editing files (it's not only indexing the libraries and gems, it's indexing your projects as well) so that would probably involve quote a lot of elisp to replicate... Hopefully once this is released I can convince you to use NetBeans instead of Emacs for some of your Ruby editing. At least that's an interesting challenge for me! You tell me what features are missing and I'll see if I can't make you happy!

Posted by Tor Norbye on January 16, 2007 at 09:23 AM PST #

Post a Comment:
Comments are closed for this entry.
About

Tor Norbye

Search

Archives
« July 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today