Tuesday, February 12, 2013

Emacs etags with TypeScript

As an emacs user working with TypeScript, the current lack of etags support is frustrating.  I found that the following command actually produces somewhat usable TAGS files:

    find . -iname '*.ts' | \
      etags -l c++ -r '/interface[ \t]+\([^ \t]+\)/\1/' -

That is, the files are parsed with the default C++ parser, and we use a regex to also extract tags for interfaces.  It's far from perfect will enable quick jumping to class and interface definitions.

No comments:

Post a Comment