Everlaw / nbts

NetBeans TypeScript editor plugin
282 stars 46 forks source link

Code Templates #5

Closed geekdenz closed 8 years ago

geekdenz commented 8 years ago

Code Templates may be a good addition to your projects and should be near trivial to implement. I would be happy to do that. At the moment the code templates are just copied from JavaScript, but I could "typify" them. I added one for arrow functions or anonymous functions like so already in our project:

arr<tab>
// results in
($parameters) => {
  $cursor
}
jeffrey-easyesi commented 8 years ago

I didn't know about that feature - that's pretty neat. If you already know how to implement it, a PR would be welcome.

geekdenz commented 8 years ago

You can assign it to me if you like. I will try to get it done now and make a pull request.

jeffrey-easyesi commented 8 years ago

Implemented by https://github.com/Everlaw/nbts/pull/10

Chris2011 commented 8 years ago

Code templates works like a charm, the problem is, that they are not shown inside the code completion. This is a pain in the ass, because I wanted to create code templates like ng2-component like the one for VS Code and I have to type the whole thing and hit tab, because the code completion will not include typescript code templates. Should I create a new ticket for this?

Chris2011 commented 8 years ago

I created a ticket for the missing code templates in the JS code completion: https://netbeans.org/bugzilla/show_bug.cgi?id=259167 and Petr Pisl fixed that with this: http://hg.netbeans.org/web-main/rev/12efdfd69406. So there you can find how he did this.