defunkt / coffee-mode

Emacs Major Mode for CoffeeScript
http://ozmm.org/posts/coffee_mode.html
574 stars 147 forks source link

imenu for methods using coroutine #364

Open gituser768 opened 7 years ago

gituser768 commented 7 years ago

I've been using bluebird's coroutine and coffeescript's yield in my async code. However, now the regex for building the function index for imenu no longer matches for all my function definitions. To work around this, I have in my emacs init:

(setq coffee-lambda-regexp "\\(?:coroutine\\s-*\\)?\\(?:([^)]*)\\)?\\s-*\\(->\\|=>\\)")

of course, this wont work if the project uses co instead of coroutine or some other API which wraps the generators created by coffeescript.

Any ideas for a more robust solution?