@@ -43,88 +43,239 @@ 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.symbol'
66+ ' "-"' : ' keyword.operator.symbol'
67+ ' "*"' : ' keyword.operator.symbol'
68+ ' "/"' : ' keyword.operator.symbol'
69+ ' "%"' : ' keyword.operator.symbol'
70+ ' "++"' : ' keyword.operator.symbol'
71+ ' "--"' : ' keyword.operator.symbol'
72+ ' "=="' : ' keyword.operator.symbol'
73+ ' "!="' : ' keyword.operator.symbol'
74+ ' ">"' : ' keyword.operator.symbol'
75+ ' "<"' : ' keyword.operator.symbol'
76+ ' ">="' : ' keyword.operator.symbol'
77+ ' "<="' : ' keyword.operator.symbol'
78+ ' "!"' : ' keyword.operator.symbol'
79+ ' "|"' : ' keyword.operator.symbol'
80+ ' "^"' : ' keyword.operator.symbol'
81+ ' "<<"' : ' keyword.operator.symbol'
82+ ' ">>"' : ' keyword.operator.symbol'
83+ ' "="' : ' keyword.operator.symbol'
84+ ' "+="' : ' keyword.operator.symbol'
85+ ' "-="' : ' keyword.operator.symbol'
86+ ' "*="' : ' keyword.operator.symbol'
87+ ' "/="' : ' keyword.operator.symbol'
88+ ' "%="' : ' keyword.operator.symbol'
89+ ' "<<="' : ' keyword.operator.symbol'
90+ ' ">>="' : ' keyword.operator.symbol'
91+ ' "&="' : ' keyword.operator.symbol'
92+ ' "^="' : ' keyword.operator.symbol'
93+ ' "|="' : ' keyword.operator.symbol'
94+ ' ":="' : ' keyword.operator.symbol'
95+ ' "&"' : ' keyword.operator.symbol'
96+ ' "&&"' : ' keyword.operator.symbol'
97+ ' "||"' : ' keyword.operator.symbol'
98+ ' "..."' : ' keyword.operator.symbol'
99+ ' "<-"' : ' keyword.operator.symbol'
100+
101+ # Storage
102+ ' "var"' : ' storage.declaration.variable'
103+ ' "const"' : ' storage.declaration.variable.immutable'
104+ ' "func"' : ' storage.declaration.function'
105+ ' "type"' : ' storage.declaration.datatype'
106+
107+ ' function_type > "func"' : ' storage.type.language.function'
108+ ' "interface"' : ' storage.type.language.interface'
109+ ' "struct"' : ' storage.type.language.structure'
110+ ' "map"' : ' storage.type.language.map'
111+ ' "chan"' : ' storage.type.language.channel'
112+
113+ ' type_identifier' : [
114+ {
115+ match : ' ^(bool|byte|complex128|complex64|error|float32|float64|int|int16|int32|int64|int8|rune|string|uint|uint16|uint32|uint64|uint8|uintptr)$' ,
116+ scopes : ' storage.type.language.primitive'
117+ },
118+ ' storage.type.entity'
119+ ]
120+
121+ # Entity
122+ ' package_identifier' : ' entity.package'
123+
124+ ' identifier' : [
125+ {
126+ exact : ' iota' ,
127+ scopes : ' entity.variable.support.iota'
128+ },
129+ ' entity.variable'
130+ ]
131+
132+ ' parameter_declaration > identifier' : [
133+ {
134+ exact : ' iota' ,
135+ scopes : ' entity.variable.support.parameter.iota'
136+ },
137+ ' entity.variable.parameter'
138+ ]
139+
140+ ' field_identifier' : ' entity.variable.member'
141+
142+ ' call_expression > identifier' : [
143+ {
144+ match : ' ^(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)$' ,
145+ scopes : ' entity.function.support.call'
146+ },
147+ ' entity.function.call'
148+ ]
149+
150+ ' call_expression > selector_expression > field_identifier' : ' entity.function.call'
151+
152+ ' function_declaration > identifier' : ' entity.function.definition'
153+ ' method_declaration > field_identifier' : ' entity.function.method.definition'
154+ ' type_declaration > type_spec > type_identifier' : ' entity.type.definition'
155+
156+ # String
157+ ' interpreted_string_literal' : ' string.quoted'
158+ ' raw_string_literal' : ' string.quoted'
159+
160+ # Constant
161+ ' escape_sequence' : [
162+ {
163+ match : ' [tf]' ,
164+ scopes : ' constant.character.escape.whitespace'
165+ },
166+ {
167+ match : ' [nr]' ,
168+ scopes : ' constant.character.escape.whitespace.newline'
169+ },
170+ ' constant.character.escape'
171+ ]
172+
173+ ' rune_literal' : ' constant.character.rune'
47174
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'
83175 ' int_literal' : ' constant.numeric.integer'
84176 ' 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'
177+ ' imaginary_literal' : ' constant.numeric.complex'
178+
179+ ' nil' : ' constant.language.null'
180+ ' true' : ' constant.language.boolean.true'
181+ ' false' : ' constant.language.boolean.false'
182+
183+ # Comment
184+ ' comment' : ' comment.block'
185+
186+ # Punctuation
187+ ' "."' : ' punctuation.accessor'
188+ ' ","' : ' punctuation.separator'
189+ ' ";"' : ' punctuation.terminator'
190+ ' ":"' : ' punctuation.definition'
191+ # '"("': 'punctuation.definition'
192+ # '")"': 'punctuation.definition'
193+ # '"{"': 'punctuation.definition'
194+ # '"}"': 'punctuation.definition'
195+ # '"["': 'punctuation.definition'
196+ # '"]"': 'punctuation.definition'
197+ ' "\\ ""' : ' punctuation.definition.string'
198+
199+ ' slice_expression > ":"' : ' punctuation.separator.slice'
200+ ' keyed_element > ":"' : ' punctuation.separator.pair'
201+
202+ ' parenthesized_expression > "("' : ' punctuation.definition.expression'
203+ ' parenthesized_expression > ")"' : ' punctuation.definition.expression'
204+
205+ ' parameter_list > "("' : ' punctuation.definition.parameters'
206+ ' parameter_list > ")"' : ' punctuation.definition.parameters'
207+
208+ ' argument_list > "("' : ' punctuation.definition.arguments'
209+ ' argument_list > ")"' : ' punctuation.definition.arguments'
210+ ' special_argument_list > "("' : ' punctuation.definition.arguments'
211+ ' special_argument_list > ")"' : ' punctuation.definition.arguments'
212+ ' type_switch_statement > "("' : ' punctuation.definition.arguments'
213+ ' type_switch_statement > ")"' : ' punctuation.definition.arguments'
214+ ' type_assertion_expression > "("' : ' punctuation.definition.arguments'
215+ ' type_assertion_expression > ")"' : ' punctuation.definition.arguments'
216+ ' type_conversion_expression > "("' : ' punctuation.definition.arguments'
217+ ' type_conversion_expression > ")"' : ' punctuation.definition.arguments'
218+
219+ ' import_spec_list > "("' : ' punctuation.definition.package'
220+ ' import_spec_list > ")"' : ' punctuation.definition.package'
221+
222+ ' const_declaration > "("' : ' punctuation.definition.variable'
223+ ' const_declaration > ")"' : ' punctuation.definition.variable'
224+ ' var_declaration > "("' : ' punctuation.definition.variable'
225+ ' var_declaration > ")"' : ' punctuation.definition.variable'
226+
227+ ' type_declaration > "("' : ' punctuation.definition.type'
228+ ' type_declaration > ")"' : ' punctuation.definition.type'
229+ ' parenthesized_type > "("' : ' punctuation.definition.type'
230+ ' parenthesized_type > ")"' : ' punctuation.definition.type'
231+
232+ ' literal_value > "{"' : ' punctuation.definition.literal'
233+ ' literal_value > "}"' : ' punctuation.definition.literal'
234+
235+ ' field_declaration_list > "{"' : ' punctuation.definition.type.structure'
236+ ' field_declaration_list > "}"' : ' punctuation.definition.type.structure'
237+
238+ ' method_spec_list > "{"' : ' punctuation.definition.type.class.abstract'
239+ ' method_spec_list > "}"' : ' punctuation.definition.type.class.abstract'
240+
241+ ' block > "{"' : ' punctuation.definition.statement'
242+ ' block > "}"' : ' punctuation.definition.statement'
243+ ' select_statement > "{"' : ' punctuation.definition.statement'
244+ ' select_statement > "}"' : ' punctuation.definition.statement'
245+ ' type_switch_statement > "{"' : ' punctuation.definition.statement'
246+ ' type_switch_statement > "}"' : ' punctuation.definition.statement'
247+ ' expression_switch_statement > "{"' : ' punctuation.definition.statement'
248+ ' expression_switch_statement > "}"' : ' punctuation.definition.statement'
249+
250+ ' func_literal > block > "{"' : ' punctuation.definition.function'
251+ ' func_literal > block > "}"' : ' punctuation.definition.function'
252+ ' function_declaration > block > "{"' : ' punctuation.definition.function'
253+ ' function_declaration > block > "}"' : ' punctuation.definition.function'
254+ ' method_declaration > block > "{"' : ' punctuation.definition.function.method'
255+ ' method_declaration > block > "}"' : ' punctuation.definition.function.method'
256+
257+ ' map_type > "["' : ' punctuation.definition.map'
258+ ' map_type > "]"' : ' punctuation.definition.map'
259+ ' slice_type > "["' : ' punctuation.definition.slice'
260+ ' slice_type > "]"' : ' punctuation.definition.slice'
261+ ' array_type > "["' : ' punctuation.definition.array'
262+ ' array_type > "]"' : ' punctuation.definition.array'
263+ ' implicit_length_array_type > "["' : ' punctuation.definition.array'
264+ ' implicit_length_array_type > "]"' : ' punctuation.definition.array'
265+
266+ ' index_expression > "["' : ' punctuation.accessor.index'
267+ ' index_expression > "]"' : ' punctuation.accessor.index'
268+ ' slice_expression > "["' : ' punctuation.accessor.slice'
269+ ' slice_expression > "]"' : ' punctuation.accessor.slice'
270+
271+ ' ERROR > "."' : ' punctuation.accessor.invalid.illegal'
272+ ' ERROR > ","' : ' punctuation.separator.invalid.illegal'
273+ ' ERROR > ";"' : ' punctuation.terminator.invalid.illegal'
274+ ' ERROR > ":"' : ' punctuation.definition.invalid.illegal'
275+ ' ERROR > "{"' : ' punctuation.definition.invalid.illegal'
276+ ' ERROR > "}"' : ' punctuation.definition.invalid.illegal'
277+ ' ERROR > "("' : ' punctuation.definition.invalid.illegal'
278+ ' ERROR > ")"' : ' punctuation.definition.invalid.illegal'
279+ ' ERROR > "["' : ' punctuation.definition.invalid.illegal'
280+ ' ERROR > "]"' : ' punctuation.definition.invalid.illegal'
281+ ' ERROR > "\\ ""' : ' punctuation.definition.string.invalid.illegal'
0 commit comments