@@ -43,88 +43,255 @@ folds: [
4343scopes :
4444 ' source_file' : ' source.go'
4545
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+ ' "map"' : ' storage.declaration.map'
117+ ' "chan"' : ' storage.declaration.channel'
118+ ' "func"' : ' storage.declaration.function'
119+ ' "type"' : ' storage.declaration.datatype'
120+ ' "struct"' : ' storage.declaration.structure'
121+ ' "interface"' : ' storage.declaration.interface'
122+
123+ ' type_identifier' : [
124+ {
125+ match : ' ^(bool|byte|complex128|complex64|error|float32|float64|int|int16|int32|int64|int8|rune|string|uint|uint16|uint32|uint64|uint8|uintptr)$' ,
126+ scopes : ' storage.type.language.primitive'
127+ },
128+ ' storage.type.entity'
129+ ]
130+
131+ # Entity
132+ ' package_identifier' : ' entity.package'
133+
134+ ' label_name' : ' entity.label'
135+
136+ ' identifier' : [
137+ {
138+ exact : ' iota' ,
139+ scopes : ' entity.variable.support.iota'
140+ },
141+ ' entity.variable'
142+ ]
143+
144+ ' parameter_declaration > identifier' : [
145+ {
146+ exact : ' iota' ,
147+ scopes : ' entity.variable.support.parameter.iota'
148+ },
149+ ' entity.variable.parameter'
150+ ]
151+
152+ ' field_identifier' : ' entity.variable.member'
153+
154+ ' call_expression > identifier' : [
155+ {
156+ match : ' ^(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)$' ,
157+ scopes : ' entity.function.support.call'
158+ },
159+ {
160+ match : ' ^(bool|byte|complex128|complex64|error|float32|float64|int|int16|int32|int64|int8|rune|string|uint|uint16|uint32|uint64|uint8|uintptr)$' ,
161+ scopes : ' entity.type.cast.language.call'
162+ },
163+ ' entity.function.call'
164+ ]
165+
166+ ' call_expression > selector_expression > field_identifier' : ' entity.function.call'
167+
168+ ' function_declaration > identifier' : ' entity.function.definition'
169+ ' method_declaration > field_identifier' : ' entity.function.method.definition'
170+ ' type_declaration > type_spec > type_identifier' : ' entity.type.definition'
171+
172+ # String
173+ ' interpreted_string_literal' : ' string.quoted'
174+ ' raw_string_literal' : ' string.quoted'
175+
176+ # Constant
177+ ' escape_sequence' : [
178+ {
179+ match : ' [tf]' ,
180+ scopes : ' constant.character.escape.whitespace'
181+ },
182+ {
183+ match : ' [nr]' ,
184+ scopes : ' constant.character.escape.whitespace.newline'
185+ },
186+ ' constant.character.escape'
187+ ]
188+
189+ ' rune_literal' : ' constant.character.rune'
47190
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'
83191 ' 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'
192+ ' float_literal' : ' constant.numeric.decimal'
193+ ' imaginary_literal' : ' constant.numeric.complex'
194+
195+ ' nil' : ' constant.language.null'
196+ ' true' : ' constant.language.boolean.true'
197+ ' false' : ' constant.language.boolean.false'
198+
199+ # Comment
200+ ' comment' : ' comment.block'
201+
202+ # Punctuation
203+ ' ":"' : ' punctuation.definition'
204+ ' "("' : ' punctuation.definition'
205+ ' ")"' : ' punctuation.definition'
206+ ' "{"' : ' punctuation.definition'
207+ ' "}"' : ' punctuation.definition'
208+ ' "["' : ' punctuation.definition'
209+ ' "]"' : ' punctuation.definition'
210+ ' ","' : ' punctuation.separator'
211+ ' ";"' : ' punctuation.terminator'
212+ ' "."' : ' punctuation.accessor.member'
213+ ' "\\ ""' : ' punctuation.definition.string'
214+
215+ ' slice_expression > ":"' : ' punctuation.separator.slice'
216+ ' keyed_element > ":"' : ' punctuation.separator.pair'
217+
218+ ' parenthesized_expression > "("' : ' punctuation.definition.expression'
219+ ' parenthesized_expression > ")"' : ' punctuation.definition.expression'
220+
221+ ' parameter_list > "("' : ' punctuation.definition.parameters'
222+ ' parameter_list > ")"' : ' punctuation.definition.parameters'
223+
224+ ' argument_list > "("' : ' punctuation.definition.arguments'
225+ ' argument_list > ")"' : ' punctuation.definition.arguments'
226+ ' special_argument_list > "("' : ' punctuation.definition.arguments'
227+ ' special_argument_list > ")"' : ' punctuation.definition.arguments'
228+ ' type_switch_statement > "("' : ' punctuation.definition.arguments'
229+ ' type_switch_statement > ")"' : ' punctuation.definition.arguments'
230+ ' type_assertion_expression > "("' : ' punctuation.definition.arguments'
231+ ' type_assertion_expression > ")"' : ' punctuation.definition.arguments'
232+ ' type_conversion_expression > "("' : ' punctuation.definition.arguments'
233+ ' type_conversion_expression > ")"' : ' punctuation.definition.arguments'
234+
235+ ' import_spec_list > "("' : ' punctuation.definition.package'
236+ ' import_spec_list > ")"' : ' punctuation.definition.package'
237+
238+ ' const_declaration > "("' : ' punctuation.definition.variable'
239+ ' const_declaration > ")"' : ' punctuation.definition.variable'
240+ ' var_declaration > "("' : ' punctuation.definition.variable'
241+ ' var_declaration > ")"' : ' punctuation.definition.variable'
242+
243+ ' type_declaration > "("' : ' punctuation.definition.type'
244+ ' type_declaration > ")"' : ' punctuation.definition.type'
245+ ' parenthesized_type > "("' : ' punctuation.definition.type'
246+ ' parenthesized_type > ")"' : ' punctuation.definition.type'
247+
248+ ' literal_value > "{"' : ' punctuation.definition.literal'
249+ ' literal_value > "}"' : ' punctuation.definition.literal'
250+
251+ ' field_declaration_list > "{"' : ' punctuation.definition.body.structure'
252+ ' field_declaration_list > "}"' : ' punctuation.definition.body.structure'
253+
254+ ' method_spec_list > "{"' : ' punctuation.definition.body.class.abstract'
255+ ' method_spec_list > "}"' : ' punctuation.definition.body.class.abstract'
256+
257+ ' block > "{"' : ' punctuation.definition.statement'
258+ ' block > "}"' : ' punctuation.definition.statement'
259+ ' select_statement > "{"' : ' punctuation.definition.statement'
260+ ' select_statement > "}"' : ' punctuation.definition.statement'
261+ ' type_switch_statement > "{"' : ' punctuation.definition.statement'
262+ ' type_switch_statement > "}"' : ' punctuation.definition.statement'
263+ ' expression_switch_statement > "{"' : ' punctuation.definition.statement'
264+ ' expression_switch_statement > "}"' : ' punctuation.definition.statement'
265+
266+ ' func_literal > block > "{"' : ' punctuation.definition.body.function'
267+ ' func_literal > block > "}"' : ' punctuation.definition.body.function'
268+ ' function_declaration > block > "{"' : ' punctuation.definition.body.function'
269+ ' function_declaration > block > "}"' : ' punctuation.definition.body.function'
270+ ' method_declaration > block > "{"' : ' punctuation.definition.body.function.method'
271+ ' method_declaration > block > "}"' : ' punctuation.definition.body.function.method'
272+
273+ ' map_type > "["' : ' punctuation.definition.collection.map'
274+ ' map_type > "]"' : ' punctuation.definition.collection.map'
275+ ' slice_type > "["' : ' punctuation.definition.collection.slice'
276+ ' slice_type > "]"' : ' punctuation.definition.collection.slice'
277+ ' array_type > "["' : ' punctuation.definition.collection.array'
278+ ' array_type > "]"' : ' punctuation.definition.collection.array'
279+ ' implicit_length_array_type > "["' : ' punctuation.definition.collection.array'
280+ ' implicit_length_array_type > "]"' : ' punctuation.definition.collection.array'
281+
282+ ' index_expression > "["' : ' punctuation.accessor.subscript.index'
283+ ' index_expression > "]"' : ' punctuation.accessor.subscript.index'
284+ ' slice_expression > "["' : ' punctuation.accessor.subscript.slice'
285+ ' slice_expression > "]"' : ' punctuation.accessor.subscript.slice'
286+
287+ ' ERROR > ":"' : ' punctuation.definition.invalid.illegal'
288+ ' ERROR > "{"' : ' punctuation.definition.invalid.illegal'
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.separator.invalid.illegal'
295+ ' ERROR > ";"' : ' punctuation.terminator.invalid.illegal'
296+ ' ERROR > "."' : ' punctuation.accessor.member.invalid.illegal'
297+ ' ERROR > "\\ ""' : ' punctuation.definition.string.invalid.illegal'
0 commit comments