Home Download Buy Blog Forum Support

JS Completions 4

JS Completions 4

Postby agibsonsw on Mon Jul 02, 2012 7:39 pm

I've created a slightly simplified, more traditional, version of my JavaScript completions AndyJS4.sublime-completions.

1) With version 3 I was including object names as part of the trigger. The idea was that, for new users, typing 'Window' would produce a list of members for the Window object. However, because it's part of the trigger, it means that a lot of unwanted items might appear in the completions list. In version 4 the object names are just completion-descriptions.
2) In version 3,typing 'alert' would prepend 'window' if there wasn't already a reference to this object typed. I've removed this feature. However, I've kept it for Math, static-methods. That is, I can type 'abs' and it will create 'Math.abs()'.

[I was fond of this prepending but: it's unfamiliar behaviour; a lot of programmers are happy to assume 'Window', or already create a variable that references the Window object.]

3) I've removed the underscore from the trigger for css-properties. Again, it was unfamiliar, and was unnecessary - particularly as the css properties are listed last in the completions file.

4) I've added $0 to the end of completions that include parameters. I think it's clearer and I prefer to tab out of the brackets.
Attachments
AndyJS4.zip
Completions as zip
(9.49 KiB) Downloaded 191 times
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 11 guests