-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsnippets.json
159 lines (159 loc) · 3.72 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
{
"If statement": {
"prefix": "if",
"body": [
"if (${1:CONDITION}) {",
"\t$2",
"}"
],
"description": "If statement"
},
"For loop": {
"prefix": "for",
"body": [
"for (${1:int} ${2:i} = 0; ${2} < ${3:n}; ${2}++) {",
"\t$0",
"}"
],
"description": "For loop"
},
"While loop": {
"prefix": "while",
"body": [
"while (${1:CONDITION}) {",
"\t$2",
"}"
],
"description": "While loop"
},
"Return statement": {
"prefix": "return",
"body": [
"return $1;"
],
"description": "Return statement"
},
"Break statement": {
"prefix": "break",
"body": [
"break;"
],
"description": "Break statement"
},
"Continue statement": {
"prefix": "continue",
"body": [
"continue;"
],
"description": "Continue statement"
},
"Do while loop": {
"prefix": "dowhile",
"body": [
"do {",
"\t$2",
"} while (${1:CONDITION});"
],
"description": "Do while loop"
},
"Switch statement": {
"prefix": "switch",
"body": [
"switch (${1:EXPRESSION}) {",
"case ${2:VALUE}:",
"\t$3",
"\tbreak;",
"default:",
"\tbreak;",
"}"
],
"description": "Switch statement"
},
"Try block": {
"prefix": "try",
"body": [
"try {",
"\t$1",
"} catch {",
"}"
],
"description": "Try catch block"
},
"Cast": {
"prefix": "cast",
"body": [
"cast<${1:TYPE}>($2)"
],
"description": "Cast to a type"
},
"Namespace definition": {
"prefix": "namespace",
"body": [
"namespace ${1:IDENTIFIER} {",
"}"
],
"description": "Namespace definition"
},
"Interface definition": {
"prefix": "interface",
"body": [
"interface ${1:IDENTIFIER} {",
"}"
],
"description": "Interface definition"
},
"Class definition": {
"prefix": "class",
"body": [
"class ${1:IDENTIFIER} {",
"}"
],
"description": "Class definition"
},
"Type definition": {
"prefix": "typedef",
"body": [
"typedef ${1:PRIMITIVE} ${2:IDENTIFIER};"
],
"description": "Alias for a type"
},
"Function handler definition": {
"prefix": "funcdef",
"body": [
"funcdef ${1:RETURN} ${2:IDENTIFIER}(${3:PARAMS});"
],
"description": "Function handler definition"
},
"Virtual property getter": {
"prefix": "getter",
"body": [
"${1:TYPE} ${2:IDENTIFIER} {",
"\tget const {",
"\t\treturn ${3:VALUE};",
"\t}",
"}"
],
"description": "Virtual property getter"
},
"Virtual property getter and setter": {
"prefix": "gettersetter",
"body": [
"${1:TYPE} ${2:IDENTIFIER} {",
"\tget const {",
"\t\treturn ${3:VALUE};",
"\t}",
"\tset {",
"\t\t${3:VALUE} = value;",
"\t}",
"}"
],
"description": "Virtual property getter and setter"
},
"Include statement": {
"prefix": "#include",
"body": [
"#include \"${1:HEADER}\""
],
"description": "Include other file"
}
}