|
4 | 4 | "body": [ |
5 | 5 | "define([", |
6 | 6 | "\t'require',", |
7 | | - "\t'${dependency}'", |
8 | | - "], function(require, ${factory}) {", |
| 7 | + "\t'${1:dependency}'", |
| 8 | + "], function(require, ${2:factory}) {", |
9 | 9 | "\t'use strict';", |
10 | 10 | "\t$0", |
11 | 11 | "});" |
|
15 | 15 | "For Loop": { |
16 | 16 | "prefix": "for", |
17 | 17 | "body": [ |
18 | | - "for (var ${index} = 0; ${index} < ${array}.length; ${index}++) {", |
19 | | - "\tvar ${element} = ${array}[${index}];", |
| 18 | + "for (var ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {", |
| 19 | + "\tvar ${3:element} = ${2:array}[${1:index}];", |
20 | 20 | "\t$0", |
21 | 21 | "}" |
22 | 22 | ], |
|
25 | 25 | "For-Each Loop": { |
26 | 26 | "prefix": "foreach", |
27 | 27 | "body": [ |
28 | | - "${array}.forEach(function(${element}) {", |
| 28 | + "${1:array}.forEach(function(${2:element}) {", |
29 | 29 | "\t$0", |
30 | 30 | "}, this);" |
31 | 31 | ], |
|
34 | 34 | "For-In Loop": { |
35 | 35 | "prefix": "forin", |
36 | 36 | "body": [ |
37 | | - "for (var ${key} in ${object}) {", |
38 | | - "\tif (${object}.hasOwnProperty(${key})) {", |
39 | | - "\t\tvar ${element} = ${object}[${key}];", |
| 37 | + "for (var ${1:key} in ${2:object}) {", |
| 38 | + "\tif (${2:object}.hasOwnProperty(${1:key})) {", |
| 39 | + "\t\tvar ${3:element} = ${2:object}[${1:key}];", |
40 | 40 | "\t\t$0", |
41 | 41 | "\t}", |
42 | 42 | "}" |
|
46 | 46 | "Function Statement": { |
47 | 47 | "prefix": "function", |
48 | 48 | "body": [ |
49 | | - "function ${name}(${params}) {", |
| 49 | + "function ${1:name}(${2:params}) {", |
50 | 50 | "\t$0", |
51 | 51 | "}" |
52 | 52 | ], |
|
55 | 55 | "If Statement": { |
56 | 56 | "prefix": "if", |
57 | 57 | "body": [ |
58 | | - "if (${condition}) {", |
| 58 | + "if (${1:condition}) {", |
59 | 59 | "\t$0", |
60 | 60 | "}" |
61 | 61 | ], |
|
64 | 64 | "If-Else Statement": { |
65 | 65 | "prefix": "ifelse", |
66 | 66 | "body": [ |
67 | | - "if (${condition}) {", |
| 67 | + "if (${1:condition}) {", |
68 | 68 | "\t$0", |
69 | 69 | "} else {", |
70 | 70 | "\t", |
|
75 | 75 | "New Statement": { |
76 | 76 | "prefix": "new", |
77 | 77 | "body": [ |
78 | | - "var ${name} = new ${type}(${arguments});$0" |
| 78 | + "var ${1:name} = new ${2:type}(${3:arguments});$0" |
79 | 79 | ], |
80 | 80 | "description": "New Statement" |
81 | 81 | }, |
82 | 82 | "Switch Statement": { |
83 | 83 | "prefix": "switch", |
84 | 84 | "body": [ |
85 | | - "switch (${key}) {", |
86 | | - "\tcase ${value}:", |
| 85 | + "switch (${1:key}) {", |
| 86 | + "\tcase ${2:value}:", |
87 | 87 | "\t\t$0", |
88 | 88 | "\t\tbreak;", |
89 | 89 | "", |
|
96 | 96 | "While Statement": { |
97 | 97 | "prefix": "while", |
98 | 98 | "body": [ |
99 | | - "while (${condition}) {", |
| 99 | + "while (${1:condition}) {", |
100 | 100 | "\t$0", |
101 | 101 | "}" |
102 | 102 | ], |
|
107 | 107 | "body": [ |
108 | 108 | "do {", |
109 | 109 | "\t$0", |
110 | | - "} while (${condition});" |
| 110 | + "} while (${1:condition});" |
111 | 111 | ], |
112 | 112 | "description": "Do-While Statement" |
113 | 113 | }, |
114 | | - "Try-Catch Statement":{ |
| 114 | + "Try-Catch Statement": { |
115 | 115 | "prefix": "trycatch", |
116 | 116 | "body": [ |
117 | 117 | "try {", |
118 | 118 | "\t$0", |
119 | | - "} catch (${error}) {", |
| 119 | + "} catch (${1:error}) {", |
120 | 120 | "\t", |
121 | 121 | "}" |
122 | 122 | ], |
|
127 | 127 | "body": [ |
128 | 128 | "setTimeout(function() {", |
129 | 129 | "\t$0", |
130 | | - "}, ${timeout});" |
| 130 | + "}, ${1:timeout});" |
131 | 131 | ], |
132 | 132 | "description": "Set Timeout Function" |
133 | 133 | }, |
|
0 commit comments