Monday, December 17, 2007

Rid of those TextMate "ctags timed out!" error

If you use TextMate for your Ruby on Rails development, you must use the ctags bundle CTags.tmbundle. It gives you a keyboard shortcut CTRL-] to jump to files that defines the class/method your cursor is on. Similar to "go to file and line" in some IDE. Super handy.

Trouble is when your project gets large, it gets longer and longer to update the tmtags index file to a point where it exceeds the default 15 seconds timout and gives a "ctags timed out!" error.

What you can do is edit the file ~/Library/Application\ Support/TextMate/Pristine\ Copy/Bundles/CTags.tmbundle/Support/bin/tmctags and increase the timeout $CtagsTimeout value to something more reasonable. Problem solved.

p.s. CTags suffers from another shortcoming, and that is it cannot index ruby methods named ending with a ? or !. Anyone knows of a fix/workaround? Please comment if you do!

1 comment:

muness said...


The problem isn't with ctags, it's with the textmate bundle. If I remember correctly, TextMate's implementation of the value set in TM_CURRENT_WORD is the problem (it's missing the non alpha numeric characters ? and !).

At one point I'd start hacking away at the findTags method (in .../bin/tmctags) to get it to look for a method ending with "?" or "!" as well. Alas, that hard drive died (I am good at that) and I haven't felt like writing Perl since.