Saturday Morning Hack

I've heard from a number of people that the ability to jump to a file by type (Open Type), or by filename (Open File) are really important to them. To the point of being adoption blockers.

Both are in the works.

NetBeans has always had a Go To Type for Java (Alt/Ctrl-Shift-O), which we're now retrofitting to become a generic Goto Type facility that other languages can plug into. That means introducing a new API etc. which requires some more effort - so this isn't there for Milestone 9. However, in the meantime, I've taken the early work on that and hacked it into a Ruby-only module which will let you jump to Ruby types. It's there in the editor context menu (under Go To), bound to a different shortcut. Unlike the general Open Type which will work from any file (or even when you're in a non-source editor window), this will only work from Ruby files. You can get the module here. That's an NBM file - a netbeans module bundle - which you can install via Tools | Plugins - just switch to the Downloaded tab and point to your NBM. Click Add Plugins. (Sorry, the modules are not signed so you'll get a warning.) It will require a restart. Also, the revamped Plugin Manager is brand new and is stabilizing right now - you may run into some issues. One thing to try is to install one module at a time. You need brand new Ruby bits for this too - go to nbextras.org.

Here's a screenshot of what it looks like (although this includes Java type matches, which the provided hacked module won't do) :

The ability to jump to any file based only on the filename (not the path) is tracked in issue 44586, and there's been some work happening in a branch. Even though it's not done, you may find it useful in your day to day work. To get it, you can download the module here. Once done, you'll have a Goto File In Project item in your Navigate menu. The operation is faster after the first time.

Finally, I've updated the TextMate snippet importer I recently discussed with some bug fixes - get the latest version here.

Comments:

Open Type/Resource has been the big thing I've been missing. I feel a bit of a navigational clutz without it. Thanks!

Posted by Si on April 21, 2007 at 06:35 PM PDT #

Wow -- thanks so much for this weekend effort!

Posted by Greg Fodor on April 24, 2007 at 03:34 AM PDT #

Got it working -- looks good. Thought you should know, it seems an exact match search doesn't quite work. If I type "Person" I get no results, but "Perso\*" yields the correct list, including the Person class. Additionally, I think an implicit \* should be at the end of your search, so if I just type "Per" I should get everything starting with Per. Thanks again, this makes the navigation usable now!

Posted by Greg Fodor on April 24, 2007 at 05:47 AM PDT #

Oddly, after an OS X update, it works as I expected. Nevermind! :)

Posted by Greg Fodor on April 25, 2007 at 04:26 AM PDT #

Great, glad to hear it! By the way, the Go To File functionality has had a few more fixes to it, and they've set up a continuous build where you can grab the latest: http://deadlock.nbextras.org/hudson/job/go%20to%20file/

Posted by Tor Norbye's Weblog on April 25, 2007 at 05:31 AM PDT #

Excellent, I was missing this one that much! So much nice stuff done the past weeks! I really need to update my charts about Ruby/Rails IDE!!

Posted by seb on April 25, 2007 at 05:31 AM PDT #

Sorry to rain on the parade, but that behavior I mentioned above is still happening. Sometimes the thing works as expected, sometimes it ignores the last character and doesn't inject a \* at the end implicitly. Sounds like a one off error to me in the code that's taking the expression from the user :)

Posted by Greg Fodor on April 25, 2007 at 10:10 AM PDT #

Hello: I am using nb M9/jruby. When I use it to edit a plain text file, the simple indentation engine does not work. For example, if you try to use nb to edit a haml file (file.haml), it would not auto indent. I know it is not exactly what you are working on but any quick help would be great. To reproduce, just open an plain empty file (that does not belong to any known category) from any project and try to edit it to see if it autoindent.

Posted by Dirk on May 07, 2007 at 08:23 PM PDT #

Hi, I found a remedy in nb help that partially resolve this issue. I added the extension to a know file object type (xml) and the indentation works. But this is not ideal as I would prefer to have a plain text file editor with indentation feature along without all the xml editor feature.

Posted by Dirk on May 07, 2007 at 08:51 PM PDT #

Wishlist: 1. support for haml template editing 2. each ruby/rail project can set its own Ruby installtion path (forexampe, one project could use CRuby and others use Jruby) instead of using global setting.

Posted by Dirk on May 07, 2007 at 09:41 PM PDT #

The latest milestone is out - Tor the Ruby installation on Mac it seems you need the full 152MB install - is the cutdown version of Netbeans available just for Ruby? (or is this not recommended)

Posted by GregH on May 09, 2007 at 07:21 PM PDT #

Hi Greg, Hope I can help. Works fine for me using the slimline netbeans-6.0m9-basic-macosx-x86.tgz, with config in (~me/).netbeans/6.0m9

I use a config file in etc, to point elsewhere for the ruby1 cluster, but putting the cluster in there should work fine too.

Posted by Si on May 10, 2007 at 01:49 AM PDT #

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

Tor Norbye

Search

Archives
« April 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
   
       
Today