technorthodox

I'm just your average 30-something, web software-writing, dog-loving, bike-riding Orthodox Christian, baritone, family guy.

I'm a Software Architect and User Experience consultant, and founder of Hovercraft Studios. You can check out my resume and portfolio to see the professional and personal projects I've been working on.

TextMate Dojo completions: dojo.require and dojo.query

Last week, I started thinking about what features I’d want in the TextMate Dojo completion bundle in order to feel good about calling it releasable. I made a list, and started knocking them down. Here are a few that I managed to tackle over the past week:

  1. It scans and executes dojo.require()s in the current file and adds their symbols to the completion context.
  2. It recognizes when you are typing inside a dojo.require() and completes dojo package names instead of functions and properties.
  3. It recognizes when you are in a dojo.query chain and completes NodeList functions while you’re in the chain.
  4. Because it understands both dojo.require and dojo.query, it will complete functions from NodeList mixins, such as dojo.NodeList-fx, that you’ve dojo.required in the current file.

How does it do that?

In a word: Javascript. I’ll be posting more about this later, once the first release is ready.

A note about performance

Any completion framework has to be fast. I’m ruthless when it comes to development tools, and I’ll bet you are too. If something slows me down, I stop using it. If the pain outweighs the benefits, it’s gone. So, one of my goals is to make sure this bundle is as fast as it can be.

The current performance is very good on my laptop. The completion popup is nearly instantaneous, even with dojo.require scanning, and hundreds of potential completions. That said, I’m using the most recent MacBook Pro rev with 8g RAM and an SSD. I realize that may not be the most common setup, so I will be testing it with other setups to make sure it doesn’t suck.

I can haz it?

A few folks have asked when they can get the bundle. Since it’s a side project, I don’t want to give a date. I’ll release an initial version when I feel it’s at the point that I’d actually use it, and I can tell you that it’s getting close :)

For now, here are a few more teasers that show the new stuff in action.

(download)

Dojo Autocomplete for TextMate

One of the biggest complaints I hear about TextMate is that it doesn't have some sort of native intellisense, and doesn't do code completion.  Those are typically features provided by "bigger" IDEs.  TextMate started life as a text editor, and has had different goals than other IDEs, so even though TextMate has grown closer to full-blown IDE over the past few years (thanks to lots of great community bundle contributions), it's not really hard to understand why it hasn't provide those features natively.

It turns out, though, that TextMate provides some builtin help for rolling your own completions, and a lot of folks have done that for various languages and platforms.  I decided to take a crack at it for Dojo as a part of a new, simplified Dojo bundle I've been working on.  Here are a couple teaser screenshots of what I have so far.

I'm not ready to post the bundle yet, but I'm actively working on it, so I hope to have an initial version ready within the next couple of weeks.

(download)

Textmate Trac Bundle Updated

I just released version 1.2 of my Textmate Trac bundle.  It includes an awesome new Preview command contributed by Tudor Marghidanu.  While editing a Trac wiki page, just hit command-option-control-p (same as Markdown, etc.) to pop up an HTML formatted preview of the page.  Seriously useful.  Thanks Tudor!

The command requires the Text::Trac perl module, which you can install from CPAN by running the following in Terminal:

sudo perl -MCPAN -e 'install Text::Trac'

If this is the first time you've used CPAN, it will probably ask you a few questions, and accepting the defaults usually works out well.

Enjoy.