@@ -43,88 +43,257 @@ folds: [
43
43
scopes :
44
44
' source_file' : ' source.go'
45
45
46
- ' comment' : ' comment.block'
46
+ # Keyword
47
+ ' "if"' : ' keyword.control.condition'
48
+ ' "else"' : ' keyword.control.condition'
49
+ ' "switch"' : ' keyword.control.condition'
50
+ ' "select"' : ' keyword.control.condition'
51
+ ' "case"' : ' keyword.control.condition'
52
+ ' "fallthrough"' : ' keyword.control.condition'
53
+ ' "default"' : ' keyword.control.condition'
54
+ ' "for"' : ' keyword.control.loop'
55
+ ' "range"' : ' keyword.control.loop'
56
+ ' "break"' : ' keyword.control.jump'
57
+ ' "return"' : ' keyword.control.jump'
58
+ ' "continue"' : ' keyword.control.jump'
59
+ ' "goto"' : ' keyword.control.jump'
60
+ ' "defer"' : ' keyword.control.jump'
61
+ ' "go"' : ' keyword.control.jump'
62
+ ' "package"' : ' keyword.control.directive'
63
+ ' "import"' : ' keyword.control.package'
64
+
65
+ ' "+"' : ' keyword.operator.arithmetic.symbol'
66
+ ' "-"' : ' keyword.operator.arithmetic.symbol'
67
+ ' binary_expression > "*"' : ' keyword.operator.arithmetic.symbol'
68
+ ' "/"' : ' keyword.operator.arithmetic.symbol'
69
+ ' "%"' : ' keyword.operator.arithmetic.symbol'
70
+ ' "++"' : ' keyword.operator.arithmetic.symbol'
71
+ ' "--"' : ' keyword.operator.arithmetic.symbol'
72
+
73
+ ' binary_expression > "&"' : ' keyword.operator.bitwise.symbol'
74
+ ' "|"' : ' keyword.operator.bitwise.symbol'
75
+ ' "^"' : ' keyword.operator.bitwise.symbol'
76
+ ' "&^"' : ' keyword.operator.bitwise.symbol'
77
+ ' "<<"' : ' keyword.operator.bitwise.shift.symbol'
78
+ ' ">>"' : ' keyword.operator.bitwise.shift.symbol'
79
+
80
+ ' "="' : ' keyword.operator.assignment.symbol'
81
+ ' ":="' : ' keyword.operator.assignment.symbol'
82
+ ' "+="' : ' keyword.operator.assignment.compound.symbol'
83
+ ' "-="' : ' keyword.operator.assignment.compound.symbol'
84
+ ' "*="' : ' keyword.operator.assignment.compound.symbol'
85
+ ' "/="' : ' keyword.operator.assignment.compound.symbol'
86
+ ' "%="' : ' keyword.operator.assignment.compound.symbol'
87
+ ' "<<="' : ' keyword.operator.assignment.compound.symbol'
88
+ ' ">>="' : ' keyword.operator.assignment.compound.symbol'
89
+ ' "&="' : ' keyword.operator.assignment.compound.symbol'
90
+ ' "|="' : ' keyword.operator.assignment.compound.symbol'
91
+ ' "^="' : ' keyword.operator.assignment.compound.symbol'
92
+
93
+ ' "=="' : ' keyword.operator.comparison.symbol'
94
+ ' "!="' : ' keyword.operator.comparison.symbol'
95
+ ' "<"' : ' keyword.operator.comparison.symbol'
96
+ ' ">"' : ' keyword.operator.comparison.symbol'
97
+ ' "<="' : ' keyword.operator.comparison.symbol'
98
+ ' ">="' : ' keyword.operator.comparison.symbol'
99
+
100
+ ' "!"' : ' keyword.operator.logical.symbol'
101
+ ' "&&"' : ' keyword.operator.logical.symbol'
102
+ ' "||"' : ' keyword.operator.logical.symbol'
103
+
104
+ ' "&"' : ' keyword.operator.pointer.reference.symbol'
105
+ ' "*"' : ' keyword.operator.pointer.dereference.symbol'
106
+
107
+ ' "<-"' : ' keyword.operator.channel.symbol'
108
+
109
+ ' variadic_parameter_declaration > "..."' : ' keyword.operator.variadic.symbol'
110
+ ' variadic_argument > "..."' : ' keyword.operator.unpack.symbol'
111
+ ' implicit_length_array_type > "..."' : ' keyword.operator.implicit.symbol'
112
+
113
+ # Storage
114
+ ' "var"' : ' storage.declaration.variable'
115
+ ' "const"' : ' storage.declaration.variable.immutable'
116
+ ' "func"' : ' storage.declaration.function'
117
+ ' "type"' : ' storage.declaration.datatype'
118
+
119
+ ' function_type > "func"' : ' storage.type.language.function'
120
+ ' "interface"' : ' storage.type.language.interface'
121
+ ' "struct"' : ' storage.type.language.structure'
122
+ ' "map"' : ' storage.type.language.map'
123
+ ' "chan"' : ' storage.type.language.channel'
124
+
125
+ ' type_identifier' : [
126
+ {
127
+ match : ' ^(bool|byte|complex128|complex64|error|float32|float64|int|int16|int32|int64|int8|rune|string|uint|uint16|uint32|uint64|uint8|uintptr)$' ,
128
+ scopes : ' storage.type.language.primitive'
129
+ },
130
+ ' storage.type.entity'
131
+ ]
132
+
133
+ # Entity
134
+ ' package_identifier' : ' entity.package'
135
+
136
+ ' label_name' : ' entity.label'
137
+
138
+ ' identifier' : [
139
+ {
140
+ exact : ' iota' ,
141
+ scopes : ' entity.variable.support.iota'
142
+ },
143
+ ' entity.variable'
144
+ ]
145
+
146
+ ' parameter_declaration > identifier' : [
147
+ {
148
+ exact : ' iota' ,
149
+ scopes : ' entity.variable.support.parameter.iota'
150
+ },
151
+ ' entity.variable.parameter'
152
+ ]
153
+
154
+ ' field_identifier' : ' entity.variable.member'
155
+
156
+ ' call_expression > identifier' : [
157
+ {
158
+ match : ' ^(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)$' ,
159
+ scopes : ' entity.function.support.call'
160
+ },
161
+ {
162
+ match : ' ^(bool|byte|complex128|complex64|error|float32|float64|int|int16|int32|int64|int8|rune|string|uint|uint16|uint32|uint64|uint8|uintptr)$' ,
163
+ scopes : ' entity.type.cast.language.call'
164
+ },
165
+ ' entity.function.call'
166
+ ]
167
+
168
+ ' call_expression > selector_expression > field_identifier' : ' entity.function.call'
169
+
170
+ ' function_declaration > identifier' : ' entity.function.definition'
171
+ ' method_declaration > field_identifier' : ' entity.function.method.definition'
172
+ ' type_declaration > type_spec > type_identifier' : ' entity.type.definition'
173
+
174
+ # String
175
+ ' interpreted_string_literal' : ' string.quoted'
176
+ ' raw_string_literal' : ' string.quoted'
177
+
178
+ # Constant
179
+ ' escape_sequence' : [
180
+ {
181
+ match : ' [tf]' ,
182
+ scopes : ' constant.character.escape.whitespace'
183
+ },
184
+ {
185
+ match : ' [nr]' ,
186
+ scopes : ' constant.character.escape.whitespace.newline'
187
+ },
188
+ ' constant.character.escape'
189
+ ]
190
+
191
+ ' rune_literal' : ' constant.character.rune'
47
192
48
- ' "var"' : ' keyword.import'
49
- ' "type"' : ' keyword.type'
50
- ' "func"' : ' keyword.function'
51
- ' "const"' : ' keyword.const'
52
- ' "struct"' : ' keyword.struct'
53
- ' "interface"' : ' keyword.interface'
54
- ' "import"' : ' keyword.import'
55
- ' "package"' : ' keyword.package'
56
- ' "map"' : ' keyword.map'
57
- ' "chan"' : ' keyword.chan'
58
-
59
- ' type_identifier' : ' support.storage.type'
60
- ' field_identifier' : ' variable.other.object.property'
61
- ' package_identifier' : ' entity.name.package'
62
-
63
- ' "if"' : ' keyword.control'
64
- ' "for"' : ' keyword.control'
65
- ' "else"' : ' keyword.control'
66
- ' "case"' : ' keyword.control'
67
- ' "break"' : ' keyword.control'
68
- ' "switch"' : ' keyword.control'
69
- ' "select"' : ' keyword.control'
70
- ' "return"' : ' keyword.control'
71
- ' "default"' : ' keyword.control'
72
- ' "continue"' : ' keyword.control'
73
- ' "goto"' : ' keyword.control'
74
- ' "fallthrough"' : ' keyword.control'
75
- ' "defer"' : ' keyword.control'
76
- ' "range"' : ' keyword.control'
77
- ' "go"' : ' keyword.control'
78
-
79
- ' interpreted_string_literal' : ' string.quoted.double'
80
- ' raw_string_literal' : ' string.quoted.double'
81
- ' escape_sequence' : ' constant.character.escape'
82
- ' rune_literal' : ' constant.other.rune'
83
193
' int_literal' : ' constant.numeric.integer'
84
- ' float_literal' : ' constant.numeric.float'
85
- ' imaginary_literal' : ' constant.numeric.integer'
86
- ' nil' : ' constant.language.nil'
87
- ' false' : ' constant.language.false'
88
- ' true' : ' constant.language.true'
89
-
90
- ' call_expression > identifier' : ' entity.name.function'
91
- ' function_declaration > identifier' : ' entity.name.function'
92
- ' method_declaration > field_identifier' : ' entity.name.function'
93
- ' call_expression > selector_expression > field_identifier' : ' entity.name.function'
94
-
95
- ' "+"' : ' keyword.operator'
96
- ' "-"' : ' keyword.operator'
97
- ' "*"' : ' keyword.operator'
98
- ' "/"' : ' keyword.operator'
99
- ' "%"' : ' keyword.operator'
100
- ' "++"' : ' keyword.operator'
101
- ' "--"' : ' keyword.operator'
102
- ' "=="' : ' keyword.operator'
103
- ' "!="' : ' keyword.operator'
104
- ' ">"' : ' keyword.operator'
105
- ' "<"' : ' keyword.operator'
106
- ' ">="' : ' keyword.operator'
107
- ' "<="' : ' keyword.operator'
108
- ' "!"' : ' keyword.operator'
109
- ' "|"' : ' keyword.operator'
110
- ' "^"' : ' keyword.operator'
111
- ' "<<"' : ' keyword.operator'
112
- ' ">>"' : ' keyword.operator'
113
- ' "="' : ' keyword.operator'
114
- ' "+="' : ' keyword.operator'
115
- ' "-="' : ' keyword.operator'
116
- ' "*="' : ' keyword.operator'
117
- ' "/="' : ' keyword.operator'
118
- ' "%="' : ' keyword.operator'
119
- ' "<<="' : ' keyword.operator'
120
- ' ">>="' : ' keyword.operator'
121
- ' "&="' : ' keyword.operator'
122
- ' "^="' : ' keyword.operator'
123
- ' "|="' : ' keyword.operator'
124
- ' ":="' : ' keyword.operator'
125
- ' "&"' : ' keyword.operator'
126
- ' "*"' : ' keyword.operator'
127
- ' "&&"' : ' keyword.operator'
128
- ' "||"' : ' keyword.operator'
129
- ' "..."' : ' keyword.operator'
130
- ' "<-"' : ' keyword.operator'
194
+ ' float_literal' : ' constant.numeric.decimal'
195
+ ' imaginary_literal' : ' constant.numeric.complex'
196
+
197
+ ' nil' : ' constant.language.null'
198
+ ' true' : ' constant.language.boolean.true'
199
+ ' false' : ' constant.language.boolean.false'
200
+
201
+ # Comment
202
+ ' comment' : ' comment.block'
203
+
204
+ # Punctuation
205
+ ' ":"' : ' punctuation.definition'
206
+ ' "("' : ' punctuation.definition'
207
+ ' ")"' : ' punctuation.definition'
208
+ ' "{"' : ' punctuation.definition'
209
+ ' "}"' : ' punctuation.definition'
210
+ ' "["' : ' punctuation.definition'
211
+ ' "]"' : ' punctuation.definition'
212
+ ' ","' : ' punctuation.separator'
213
+ ' ";"' : ' punctuation.terminator'
214
+ ' "."' : ' punctuation.accessor.member'
215
+ ' "\\ ""' : ' punctuation.definition.string'
216
+
217
+ ' slice_expression > ":"' : ' punctuation.separator.slice'
218
+ ' keyed_element > ":"' : ' punctuation.separator.pair'
219
+
220
+ ' parenthesized_expression > "("' : ' punctuation.definition.expression'
221
+ ' parenthesized_expression > ")"' : ' punctuation.definition.expression'
222
+
223
+ ' parameter_list > "("' : ' punctuation.definition.parameters'
224
+ ' parameter_list > ")"' : ' punctuation.definition.parameters'
225
+
226
+ ' argument_list > "("' : ' punctuation.definition.arguments'
227
+ ' argument_list > ")"' : ' punctuation.definition.arguments'
228
+ ' special_argument_list > "("' : ' punctuation.definition.arguments'
229
+ ' special_argument_list > ")"' : ' punctuation.definition.arguments'
230
+ ' type_switch_statement > "("' : ' punctuation.definition.arguments'
231
+ ' type_switch_statement > ")"' : ' punctuation.definition.arguments'
232
+ ' type_assertion_expression > "("' : ' punctuation.definition.arguments'
233
+ ' type_assertion_expression > ")"' : ' punctuation.definition.arguments'
234
+ ' type_conversion_expression > "("' : ' punctuation.definition.arguments'
235
+ ' type_conversion_expression > ")"' : ' punctuation.definition.arguments'
236
+
237
+ ' import_spec_list > "("' : ' punctuation.definition.package'
238
+ ' import_spec_list > ")"' : ' punctuation.definition.package'
239
+
240
+ ' const_declaration > "("' : ' punctuation.definition.variable'
241
+ ' const_declaration > ")"' : ' punctuation.definition.variable'
242
+ ' var_declaration > "("' : ' punctuation.definition.variable'
243
+ ' var_declaration > ")"' : ' punctuation.definition.variable'
244
+
245
+ ' type_declaration > "("' : ' punctuation.definition.type'
246
+ ' type_declaration > ")"' : ' punctuation.definition.type'
247
+ ' parenthesized_type > "("' : ' punctuation.definition.type'
248
+ ' parenthesized_type > ")"' : ' punctuation.definition.type'
249
+
250
+ ' literal_value > "{"' : ' punctuation.definition.literal'
251
+ ' literal_value > "}"' : ' punctuation.definition.literal'
252
+
253
+ ' field_declaration_list > "{"' : ' punctuation.definition.body.structure'
254
+ ' field_declaration_list > "}"' : ' punctuation.definition.body.structure'
255
+
256
+ ' method_spec_list > "{"' : ' punctuation.definition.body.class.abstract'
257
+ ' method_spec_list > "}"' : ' punctuation.definition.body.class.abstract'
258
+
259
+ ' block > "{"' : ' punctuation.definition.statement'
260
+ ' block > "}"' : ' punctuation.definition.statement'
261
+ ' select_statement > "{"' : ' punctuation.definition.statement'
262
+ ' select_statement > "}"' : ' punctuation.definition.statement'
263
+ ' type_switch_statement > "{"' : ' punctuation.definition.statement'
264
+ ' type_switch_statement > "}"' : ' punctuation.definition.statement'
265
+ ' expression_switch_statement > "{"' : ' punctuation.definition.statement'
266
+ ' expression_switch_statement > "}"' : ' punctuation.definition.statement'
267
+
268
+ ' func_literal > block > "{"' : ' punctuation.definition.body.function'
269
+ ' func_literal > block > "}"' : ' punctuation.definition.body.function'
270
+ ' function_declaration > block > "{"' : ' punctuation.definition.body.function'
271
+ ' function_declaration > block > "}"' : ' punctuation.definition.body.function'
272
+ ' method_declaration > block > "{"' : ' punctuation.definition.body.function.method'
273
+ ' method_declaration > block > "}"' : ' punctuation.definition.body.function.method'
274
+
275
+ ' map_type > "["' : ' punctuation.definition.collection.map'
276
+ ' map_type > "]"' : ' punctuation.definition.collection.map'
277
+ ' slice_type > "["' : ' punctuation.definition.collection.slice'
278
+ ' slice_type > "]"' : ' punctuation.definition.collection.slice'
279
+ ' array_type > "["' : ' punctuation.definition.collection.array'
280
+ ' array_type > "]"' : ' punctuation.definition.collection.array'
281
+ ' implicit_length_array_type > "["' : ' punctuation.definition.collection.array'
282
+ ' implicit_length_array_type > "]"' : ' punctuation.definition.collection.array'
283
+
284
+ ' index_expression > "["' : ' punctuation.accessor.subscript.index'
285
+ ' index_expression > "]"' : ' punctuation.accessor.subscript.index'
286
+ ' slice_expression > "["' : ' punctuation.accessor.subscript.slice'
287
+ ' slice_expression > "]"' : ' punctuation.accessor.subscript.slice'
288
+
289
+ ' ERROR > ":"' : ' punctuation.definition.invalid.illegal'
290
+ ' ERROR > "{"' : ' punctuation.definition.invalid.illegal'
291
+ ' ERROR > "}"' : ' punctuation.definition.invalid.illegal'
292
+ ' ERROR > "("' : ' punctuation.definition.invalid.illegal'
293
+ ' ERROR > ")"' : ' punctuation.definition.invalid.illegal'
294
+ ' ERROR > "["' : ' punctuation.definition.invalid.illegal'
295
+ ' ERROR > "]"' : ' punctuation.definition.invalid.illegal'
296
+ ' ERROR > ","' : ' punctuation.separator.invalid.illegal'
297
+ ' ERROR > ";"' : ' punctuation.terminator.invalid.illegal'
298
+ ' ERROR > "."' : ' punctuation.accessor.member.invalid.illegal'
299
+ ' ERROR > "\\ ""' : ' punctuation.definition.string.invalid.illegal'
0 commit comments