Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ctags definitions for Coffeescript. Very basic for now. "> ctags -e -R source_folder" and then M-. to jump to the definition of any function or variable (if you're using emacs)
--langdef=coffee
--langmap=coffee:.coffee
# Detects classes, static/class methods, plain functions and variables.
--regex-coffee=/^class ([A-Za-z.]+)( extends [A-Za-z.]+)?$/\1/c,class/
--regex-coffee=/^[ \t]*@?([A-Za-z.]+):.*[-=]>.*$/\1/f,function/
--regex-coffee=/^[ \t]*([A-Za-z.]+)[ \t]+=.*[-=]>.*$/\1/f,function/
--regex-coffee=/^[ \t]*([A-Za-z.]+)[ \t]+=[^->\n]*$/\1/v,variable/
@bogdan

This comment has been minimized.

Copy link

commented Dec 13, 2011

Thanks a lot.

A needed wrap regexp with "" before I make it work

@rosenfeld

This comment has been minimized.

Copy link

commented Apr 17, 2012

You can also declare a class like this:

(export ? window).MyClass = class MyClass
constructor: ...

I mean, it doesn't need to start with "class":

https://gist.github.com/2405554

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.