sublime-better-coffeescript
sublime-better-coffeescript copied to clipboard
can't capture the super classes when class has no name.

Thank you for your work.
The current Textmate and Sublime matcher is
(class\b)\s+(@?[a-zA-Z\$_][\w\.]*)?(?:\s+(extends)\s+(@?[a-zA-Z\$\._][\w\.]*))?
https://regex101.com/r/uD2jC1/1

It matches the term "extends" as if it's the name of a class, which breaks matching after that.
I think we can add a negative lookahead to the second matcher (currently: (@?[a-zA-Z\$_][\w\.]*)) so that it won't match the phrase "extends".
(class\b)\s+((?!extends)@?[a-zA-Z\$_][\w\.]*)?(?:\s*(extends)\s+(@?[a-zA-Z\$\._][\w\.]*))?
https://regex101.com/r/uD2jC1/3

The first problem that comes to mind with this is that it'd mess up if you named your class "extends", but that'd be invalid coffeescript anyway.