-
Notifications
You must be signed in to change notification settings - Fork 6
/
snippets.json
180 lines (180 loc) · 3.1 KB
/
snippets.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
{
"Initialize Processing Sketch": {
"prefix": "setup()",
"body": [
"public void setup(){",
"\t$1",
"}",
"public void draw(){",
"\t$2",
"}"
],
"description": "Initialize Processing Sketch"
},
"sysout": {
"prefix": "sysout",
"body": [
"System.out.println($0);"
],
"description": "Print to standard out"
},
"fori": {
"prefix": "fori",
"body": [
"for (${1:int} ${2:i} = ${3:0}; $2 < ${4:max}; $2++) {",
"\t$0",
"}"
],
"description": "Indexed for loop"
},
"foreach": {
"prefix": "foreach",
"body": [
"for (${1:type} ${2:var} : ${3:iterable}) {",
"\t$0",
"}"
],
"description": "Enhanced for loop"
},
"Public constructor": {
"prefix": "ctor",
"body": [
"public ${1:${TM_FILENAME_BASE}}($2) {",
"\t${0:super();}",
"}"
],
"description": "Public constructor"
},
"if": {
"prefix": "if",
"body": [
"if (${1:condition}) {",
"\t$0",
"}"
],
"description": "if statement"
},
"ifelse": {
"prefix": "ifelse",
"body": [
"if (${1:condition}) {",
"\t$2",
"} else {",
"\t$0",
"}"
],
"description": "if/else statement"
},
"ifnull": {
"prefix": "ifnull",
"body": [
"if (${1:condition} == null) {",
"\t$0",
"}"
],
"description": "if statement checking for null"
},
"ifnotnull": {
"prefix": "ifnotnull",
"body": [
"if (${1:condition} != null) {",
"\t$0",
"}"
],
"description": "if statement checking for not null"
},
"trycatch": {
"prefix": "try catch",
"body": [
"try {",
"\t$1",
"} catch (${2:Exception} ${3:e}) {",
"\t$4//${0:TODO}: handle exception",
"}"
],
"description": "try/catch block"
},
"tryresources": {
"prefix": "try resources",
"body": [
"try ($1) {",
"\t$2",
"} catch (${3:Exception} ${4:e}) {",
"\t$5//${0:TODO}: handle exception",
"}"
]
},
"private_method": {
"prefix": "private method",
"body": [
"private ${1:void} ${2:name}($3) {",
"\t$0",
"}"
],
"description": "private method"
},
"Public method": {
"prefix": "public method",
"body": [
"public ${1:void} ${2:name}(${3}) {",
"\t$0",
"}"
],
"description": "public method"
},
"Protected Method": {
"prefix": "protected method",
"body": [
"protected ${1:void} ${2:name}(${3}) {",
"\t$0",
"}"
],
"description": "Protected method"
},
"Switch Statement": {
"prefix": "switch",
"body": [
"switch (${1:key}) {",
"\tcase ${2:value}:",
"\t\t$0",
"\t\tbreak;",
"",
"\tdefault:",
"\t\tbreak;",
"}"
],
"description": "Switch Statement"
},
"While Statement": {
"prefix": "while",
"body": [
"while (${1:condition}) {",
"\t$0",
"}"
],
"description": "While Statement"
},
"Do-While Statement": {
"prefix": "dowhile",
"body": [
"do {",
"\t$0",
"} while (${1:condition});"
],
"description": "Do-While Statement"
},
"newObject": {
"prefix": "new",
"body": [
"${0:Object} ${1:foo} = new ${0:Object}();"
],
"description": "Create new Object"
},
"Private field": {
"prefix": "prf",
"body": [
"private ${1:String} ${2:name};"
],
"description": "Private field"
}
}