AdamNiederer / ng2-mode

Angular Support for Emacs
GNU General Public License v3.0
73 stars 11 forks source link

Support more decorators #16

Closed tam5 closed 5 years ago

tam5 commented 5 years ago

Any reason the current list of decorators is hardcoded to a select few? There are way more decorators that come into everyday use, (@Injectable, @Input, @Output, @ContentChild, @ViewChild, etc).

Should this be based on a regex?

AdamNiederer commented 5 years ago

Most likely - I wrote this back when Angular 2 was still in beta, and those decorators were the only ones I was aware of. We could do something like @[A-Za-z0-9_] without much issue.

tam5 commented 5 years ago

makes sense. care to make the update? or would u like a pr

OlleLinderos commented 5 years ago

I make a PR for this. I guess \(@[A-Za-z0-9_]+\) could be good enough, although it could be improved.

AdamNiederer commented 5 years ago

We now highlight all decorators, as long as the name of the decorator is a valid Typescript identifier. Feel free to re-open or let me know if you're still having trouble after updating ng2-mode.