Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/go/syntaxes/go.tmLanguage.json
3292 views
1
{
2
"information_for_contributors": [
3
"This file has been converted from https://github.com/worlpaker/go-syntax/blob/master/syntaxes/go.tmLanguage.json",
4
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
5
"Once accepted there, we are happy to receive an update request."
6
],
7
"version": "https://github.com/worlpaker/go-syntax/commit/8c70c078f56d237f72574ce49cc95839c4f8a741",
8
"name": "Go",
9
"scopeName": "source.go",
10
"patterns": [
11
{
12
"include": "#statements"
13
}
14
],
15
"repository": {
16
"statements": {
17
"patterns": [
18
{
19
"include": "#package_name"
20
},
21
{
22
"include": "#import"
23
},
24
{
25
"include": "#syntax_errors"
26
},
27
{
28
"include": "#group-functions"
29
},
30
{
31
"include": "#group-types"
32
},
33
{
34
"include": "#group-variables"
35
},
36
{
37
"include": "#hover"
38
}
39
]
40
},
41
"group-functions": {
42
"comment": "all statements related to functions",
43
"patterns": [
44
{
45
"include": "#function_declaration"
46
},
47
{
48
"include": "#functions_inline"
49
},
50
{
51
"include": "#functions"
52
},
53
{
54
"include": "#built_in_functions"
55
},
56
{
57
"include": "#support_functions"
58
}
59
]
60
},
61
"group-types": {
62
"comment": "all statements related to types",
63
"patterns": [
64
{
65
"include": "#other_struct_interface_expressions"
66
},
67
{
68
"include": "#type_assertion_inline"
69
},
70
{
71
"include": "#struct_variables_types"
72
},
73
{
74
"include": "#interface_variables_types"
75
},
76
{
77
"include": "#single_type"
78
},
79
{
80
"include": "#multi_types"
81
},
82
{
83
"include": "#struct_interface_declaration"
84
},
85
{
86
"include": "#double_parentheses_types"
87
},
88
{
89
"include": "#switch_types"
90
},
91
{
92
"include": "#type-declarations"
93
}
94
]
95
},
96
"group-variables": {
97
"comment": "all statements related to variables",
98
"patterns": [
99
{
100
"include": "#const_assignment"
101
},
102
{
103
"include": "#var_assignment"
104
},
105
{
106
"include": "#variable_assignment"
107
},
108
{
109
"include": "#label_loop_variables"
110
},
111
{
112
"include": "#slice_index_variables"
113
},
114
{
115
"include": "#property_variables"
116
},
117
{
118
"include": "#switch_variables"
119
},
120
{
121
"include": "#other_variables"
122
}
123
]
124
},
125
"type-declarations": {
126
"comment": "includes all type declarations",
127
"patterns": [
128
{
129
"include": "#language_constants"
130
},
131
{
132
"include": "#comments"
133
},
134
{
135
"include": "#map_types"
136
},
137
{
138
"include": "#brackets"
139
},
140
{
141
"include": "#delimiters"
142
},
143
{
144
"include": "#keywords"
145
},
146
{
147
"include": "#operators"
148
},
149
{
150
"include": "#runes"
151
},
152
{
153
"include": "#storage_types"
154
},
155
{
156
"include": "#raw_string_literals"
157
},
158
{
159
"include": "#string_literals"
160
},
161
{
162
"include": "#numeric_literals"
163
},
164
{
165
"include": "#terminators"
166
}
167
]
168
},
169
"type-declarations-without-brackets": {
170
"comment": "includes all type declarations without brackets (in some cases, brackets need to be captured manually)",
171
"patterns": [
172
{
173
"include": "#language_constants"
174
},
175
{
176
"include": "#comments"
177
},
178
{
179
"include": "#map_types"
180
},
181
{
182
"include": "#delimiters"
183
},
184
{
185
"include": "#keywords"
186
},
187
{
188
"include": "#operators"
189
},
190
{
191
"include": "#runes"
192
},
193
{
194
"include": "#storage_types"
195
},
196
{
197
"include": "#raw_string_literals"
198
},
199
{
200
"include": "#string_literals"
201
},
202
{
203
"include": "#numeric_literals"
204
},
205
{
206
"include": "#terminators"
207
}
208
]
209
},
210
"parameter-variable-types": {
211
"comment": "function and generic parameter types",
212
"patterns": [
213
{
214
"match": "\\{",
215
"name": "punctuation.definition.begin.bracket.curly.go"
216
},
217
{
218
"match": "\\}",
219
"name": "punctuation.definition.end.bracket.curly.go"
220
},
221
{
222
"begin": "([\\w\\.\\*]+)?(\\[)",
223
"beginCaptures": {
224
"1": {
225
"patterns": [
226
{
227
"include": "#type-declarations"
228
},
229
{
230
"match": "\\w+",
231
"name": "entity.name.type.go"
232
}
233
]
234
},
235
"2": {
236
"name": "punctuation.definition.begin.bracket.square.go"
237
}
238
},
239
"end": "\\]",
240
"endCaptures": {
241
"0": {
242
"name": "punctuation.definition.end.bracket.square.go"
243
}
244
},
245
"patterns": [
246
{
247
"include": "#generic_param_types"
248
}
249
]
250
},
251
{
252
"begin": "\\(",
253
"beginCaptures": {
254
"0": {
255
"name": "punctuation.definition.begin.bracket.round.go"
256
}
257
},
258
"end": "\\)",
259
"endCaptures": {
260
"0": {
261
"name": "punctuation.definition.end.bracket.round.go"
262
}
263
},
264
"patterns": [
265
{
266
"include": "#function_param_types"
267
}
268
]
269
}
270
]
271
},
272
"language_constants": {
273
"comment": "Language constants",
274
"match": "\\b(?:(true|false)|(nil)|(iota))\\b",
275
"captures": {
276
"1": {
277
"name": "constant.language.boolean.go"
278
},
279
"2": {
280
"name": "constant.language.null.go"
281
},
282
"3": {
283
"name": "constant.language.iota.go"
284
}
285
}
286
},
287
"comments": {
288
"patterns": [
289
{
290
"name": "comment.block.go",
291
"begin": "(\\/\\*)",
292
"beginCaptures": {
293
"1": {
294
"name": "punctuation.definition.comment.go"
295
}
296
},
297
"end": "(\\*\\/)",
298
"endCaptures": {
299
"1": {
300
"name": "punctuation.definition.comment.go"
301
}
302
}
303
},
304
{
305
"name": "comment.line.double-slash.go",
306
"begin": "(\\/\\/)",
307
"beginCaptures": {
308
"1": {
309
"name": "punctuation.definition.comment.go"
310
}
311
},
312
"end": "(?:\\n|$)"
313
}
314
]
315
},
316
"map_types": {
317
"comment": "map types",
318
"begin": "(\\bmap\\b)(\\[)",
319
"beginCaptures": {
320
"1": {
321
"name": "keyword.map.go"
322
},
323
"2": {
324
"name": "punctuation.definition.begin.bracket.square.go"
325
}
326
},
327
"end": "(?:(\\])((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?!(?:[\\[\\]\\*]+)?\\b(?:func|struct|map)\\b)(?:[\\*\\[\\]]+)?(?:[\\w\\.]+)(?:\\[(?:(?:[\\w\\.\\*\\[\\]\\{\\}]+)(?:(?:\\,\\s*(?:[\\w\\.\\*\\[\\]\\{\\}]+))*))?\\])?)?)",
328
"endCaptures": {
329
"1": {
330
"name": "punctuation.definition.end.bracket.square.go"
331
},
332
"2": {
333
"patterns": [
334
{
335
"include": "#type-declarations-without-brackets"
336
},
337
{
338
"match": "\\[",
339
"name": "punctuation.definition.begin.bracket.square.go"
340
},
341
{
342
"match": "\\]",
343
"name": "punctuation.definition.end.bracket.square.go"
344
},
345
{
346
"match": "\\w+",
347
"name": "entity.name.type.go"
348
}
349
]
350
}
351
},
352
"patterns": [
353
{
354
"include": "#type-declarations-without-brackets"
355
},
356
{
357
"include": "#parameter-variable-types"
358
},
359
{
360
"include": "#functions"
361
},
362
{
363
"match": "\\[",
364
"name": "punctuation.definition.begin.bracket.square.go"
365
},
366
{
367
"match": "\\]",
368
"name": "punctuation.definition.end.bracket.square.go"
369
},
370
{
371
"match": "\\{",
372
"name": "punctuation.definition.begin.bracket.curly.go"
373
},
374
{
375
"match": "\\}",
376
"name": "punctuation.definition.end.bracket.curly.go"
377
},
378
{
379
"match": "\\(",
380
"name": "punctuation.definition.begin.bracket.round.go"
381
},
382
{
383
"match": "\\)",
384
"name": "punctuation.definition.end.bracket.round.go"
385
},
386
{
387
"match": "\\w+",
388
"name": "entity.name.type.go"
389
}
390
]
391
},
392
"brackets": {
393
"patterns": [
394
{
395
"begin": "\\{",
396
"beginCaptures": {
397
"0": {
398
"name": "punctuation.definition.begin.bracket.curly.go"
399
}
400
},
401
"end": "\\}",
402
"endCaptures": {
403
"0": {
404
"name": "punctuation.definition.end.bracket.curly.go"
405
}
406
},
407
"patterns": [
408
{
409
"include": "$self"
410
}
411
]
412
},
413
{
414
"begin": "\\(",
415
"beginCaptures": {
416
"0": {
417
"name": "punctuation.definition.begin.bracket.round.go"
418
}
419
},
420
"end": "\\)",
421
"endCaptures": {
422
"0": {
423
"name": "punctuation.definition.end.bracket.round.go"
424
}
425
},
426
"patterns": [
427
{
428
"include": "$self"
429
}
430
]
431
},
432
{
433
"begin": "\\[",
434
"beginCaptures": {
435
"0": {
436
"name": "punctuation.definition.begin.bracket.square.go"
437
}
438
},
439
"end": "\\]",
440
"endCaptures": {
441
"0": {
442
"name": "punctuation.definition.end.bracket.square.go"
443
}
444
},
445
"patterns": [
446
{
447
"include": "$self"
448
}
449
]
450
}
451
]
452
},
453
"delimiters": {
454
"patterns": [
455
{
456
"match": "\\,",
457
"name": "punctuation.other.comma.go"
458
},
459
{
460
"match": "\\.(?!\\.\\.)",
461
"name": "punctuation.other.period.go"
462
},
463
{
464
"match": ":(?!=)",
465
"name": "punctuation.other.colon.go"
466
}
467
]
468
},
469
"keywords": {
470
"patterns": [
471
{
472
"comment": "Flow control keywords",
473
"match": "\\b(break|case|continue|default|defer|else|fallthrough|for|go|goto|if|range|return|select|switch)\\b",
474
"name": "keyword.control.go"
475
},
476
{
477
"match": "\\bchan\\b",
478
"name": "keyword.channel.go"
479
},
480
{
481
"match": "\\bconst\\b",
482
"name": "keyword.const.go"
483
},
484
{
485
"match": "\\bvar\\b",
486
"name": "keyword.var.go"
487
},
488
{
489
"match": "\\bfunc\\b",
490
"name": "keyword.function.go"
491
},
492
{
493
"match": "\\binterface\\b",
494
"name": "keyword.interface.go"
495
},
496
{
497
"match": "\\bmap\\b",
498
"name": "keyword.map.go"
499
},
500
{
501
"match": "\\bstruct\\b",
502
"name": "keyword.struct.go"
503
},
504
{
505
"match": "\\bimport\\b",
506
"name": "keyword.control.import.go"
507
},
508
{
509
"match": "\\btype\\b",
510
"name": "keyword.type.go"
511
}
512
]
513
},
514
"operators": {
515
"comment": "Note that the order here is very important!",
516
"patterns": [
517
{
518
"match": "(?<!\\w)(?:\\*|\\&)+(?:(?!\\d)(?=(?:[\\w\\[\\]])|(?:\\<\\-)))",
519
"name": "keyword.operator.address.go"
520
},
521
{
522
"match": "<\\-",
523
"name": "keyword.operator.channel.go"
524
},
525
{
526
"match": "\\-\\-",
527
"name": "keyword.operator.decrement.go"
528
},
529
{
530
"match": "\\+\\+",
531
"name": "keyword.operator.increment.go"
532
},
533
{
534
"match": "(==|!=|<=|>=|<(?!<)|>(?!>))",
535
"name": "keyword.operator.comparison.go"
536
},
537
{
538
"match": "(&&|\\|\\||!)",
539
"name": "keyword.operator.logical.go"
540
},
541
{
542
"match": "(=|\\+=|\\-=|\\|=|\\^=|\\*=|/=|:=|%=|<<=|>>=|&\\^=|&=)",
543
"name": "keyword.operator.assignment.go"
544
},
545
{
546
"match": "(\\+|\\-|\\*|/|%)",
547
"name": "keyword.operator.arithmetic.go"
548
},
549
{
550
"match": "(&(?!\\^)|\\||\\^|&\\^|<<|>>|\\~)",
551
"name": "keyword.operator.arithmetic.bitwise.go"
552
},
553
{
554
"match": "\\.\\.\\.",
555
"name": "keyword.operator.ellipsis.go"
556
}
557
]
558
},
559
"runes": {
560
"patterns": [
561
{
562
"begin": "'",
563
"beginCaptures": {
564
"0": {
565
"name": "punctuation.definition.string.begin.go"
566
}
567
},
568
"end": "'",
569
"endCaptures": {
570
"0": {
571
"name": "punctuation.definition.string.end.go"
572
}
573
},
574
"name": "string.quoted.rune.go",
575
"patterns": [
576
{
577
"match": "\\G(\\\\([0-7]{3}|[abfnrtv\\\\'\"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})|.)(?=')",
578
"name": "constant.other.rune.go"
579
},
580
{
581
"match": "[^']+",
582
"name": "invalid.illegal.unknown-rune.go"
583
}
584
]
585
}
586
]
587
},
588
"storage_types": {
589
"patterns": [
590
{
591
"match": "\\bbool\\b",
592
"name": "storage.type.boolean.go"
593
},
594
{
595
"match": "\\bbyte\\b",
596
"name": "storage.type.byte.go"
597
},
598
{
599
"match": "\\berror\\b",
600
"name": "storage.type.error.go"
601
},
602
{
603
"match": "\\b(complex(64|128)|float(32|64)|u?int(8|16|32|64)?)\\b",
604
"name": "storage.type.numeric.go"
605
},
606
{
607
"match": "\\brune\\b",
608
"name": "storage.type.rune.go"
609
},
610
{
611
"match": "\\bstring\\b",
612
"name": "storage.type.string.go"
613
},
614
{
615
"match": "\\buintptr\\b",
616
"name": "storage.type.uintptr.go"
617
},
618
{
619
"match": "\\bany\\b",
620
"name": "entity.name.type.any.go"
621
},
622
{
623
"match": "\\bcomparable\\b",
624
"name": "entity.name.type.comparable.go"
625
}
626
]
627
},
628
"raw_string_literals": {
629
"comment": "Raw string literals",
630
"begin": "`",
631
"beginCaptures": {
632
"0": {
633
"name": "punctuation.definition.string.begin.go"
634
}
635
},
636
"end": "`",
637
"endCaptures": {
638
"0": {
639
"name": "punctuation.definition.string.end.go"
640
}
641
},
642
"name": "string.quoted.raw.go",
643
"patterns": [
644
{
645
"include": "#string_placeholder"
646
}
647
]
648
},
649
"string_literals": {
650
"patterns": [
651
{
652
"comment": "Interpreted string literals",
653
"begin": "\"",
654
"beginCaptures": {
655
"0": {
656
"name": "punctuation.definition.string.begin.go"
657
}
658
},
659
"end": "\"",
660
"endCaptures": {
661
"0": {
662
"name": "punctuation.definition.string.end.go"
663
}
664
},
665
"name": "string.quoted.double.go",
666
"patterns": [
667
{
668
"include": "#string_escaped_char"
669
},
670
{
671
"include": "#string_placeholder"
672
}
673
]
674
}
675
]
676
},
677
"string_escaped_char": {
678
"patterns": [
679
{
680
"match": "\\\\([0-7]{3}|[abfnrtv\\\\'\"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})",
681
"name": "constant.character.escape.go"
682
},
683
{
684
"match": "\\\\[^0-7xuUabfnrtv\\'\"]",
685
"name": "invalid.illegal.unknown-escape.go"
686
}
687
]
688
},
689
"string_placeholder": {
690
"patterns": [
691
{
692
"match": "%(\\[\\d+\\])?([\\+#\\-0\\x20]{,2}((\\d+|\\*)?(\\.?(\\d+|\\*|(\\[\\d+\\])\\*?)?(\\[\\d+\\])?)?))?[vT%tbcdoqxXUbeEfFgGspw]",
693
"name": "constant.other.placeholder.go"
694
}
695
]
696
},
697
"numeric_literals": {
698
"match": "(?<!\\w)\\.?\\d(?:(?:[0-9a-zA-Z_\\.])|(?<=[eEpP])[+-])*",
699
"captures": {
700
"0": {
701
"patterns": [
702
{
703
"begin": "(?=.)",
704
"end": "(?:\\n|$)",
705
"patterns": [
706
{
707
"match": "(?:(?:(?:(?:(?:\\G(?=[0-9.])(?!0[xXbBoO])([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)((?:(?<=[0-9])\\.|\\.(?=[0-9])))([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)?(?:(?<!_)([eE])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)))?(i(?!\\w))?(?:\\n|$)|\\G(?=[0-9.])(?!0[xXbBoO])([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(?<!_)([eE])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*))(i(?!\\w))?(?:\\n|$))|\\G((?:(?<=[0-9])\\.|\\.(?=[0-9])))([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(?:(?<!_)([eE])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)))?(i(?!\\w))?(?:\\n|$))|(\\G0[xX])_?([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)((?:(?<=[0-9a-fA-F])\\.|\\.(?=[0-9a-fA-F])))([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)?(?<!_)([pP])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*))(i(?!\\w))?(?:\\n|$))|(\\G0[xX])_?([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(?<!_)([pP])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*))(i(?!\\w))?(?:\\n|$))|(\\G0[xX])((?:(?<=[0-9a-fA-F])\\.|\\.(?=[0-9a-fA-F])))([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(?<!_)([pP])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*))(i(?!\\w))?(?:\\n|$))",
708
"captures": {
709
"1": {
710
"name": "constant.numeric.decimal.go",
711
"patterns": [
712
{
713
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
714
"name": "punctuation.separator.constant.numeric.go"
715
}
716
]
717
},
718
"2": {
719
"name": "punctuation.separator.constant.numeric.go"
720
},
721
"3": {
722
"name": "constant.numeric.decimal.point.go"
723
},
724
"4": {
725
"name": "constant.numeric.decimal.go",
726
"patterns": [
727
{
728
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
729
"name": "punctuation.separator.constant.numeric.go"
730
}
731
]
732
},
733
"5": {
734
"name": "punctuation.separator.constant.numeric.go"
735
},
736
"6": {
737
"name": "keyword.other.unit.exponent.decimal.go"
738
},
739
"7": {
740
"name": "keyword.operator.plus.exponent.decimal.go"
741
},
742
"8": {
743
"name": "keyword.operator.minus.exponent.decimal.go"
744
},
745
"9": {
746
"name": "constant.numeric.exponent.decimal.go",
747
"patterns": [
748
{
749
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
750
"name": "punctuation.separator.constant.numeric.go"
751
}
752
]
753
},
754
"10": {
755
"name": "keyword.other.unit.imaginary.go"
756
},
757
"11": {
758
"name": "constant.numeric.decimal.go",
759
"patterns": [
760
{
761
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
762
"name": "punctuation.separator.constant.numeric.go"
763
}
764
]
765
},
766
"12": {
767
"name": "punctuation.separator.constant.numeric.go"
768
},
769
"13": {
770
"name": "keyword.other.unit.exponent.decimal.go"
771
},
772
"14": {
773
"name": "keyword.operator.plus.exponent.decimal.go"
774
},
775
"15": {
776
"name": "keyword.operator.minus.exponent.decimal.go"
777
},
778
"16": {
779
"name": "constant.numeric.exponent.decimal.go",
780
"patterns": [
781
{
782
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
783
"name": "punctuation.separator.constant.numeric.go"
784
}
785
]
786
},
787
"17": {
788
"name": "keyword.other.unit.imaginary.go"
789
},
790
"18": {
791
"name": "constant.numeric.decimal.point.go"
792
},
793
"19": {
794
"name": "constant.numeric.decimal.go",
795
"patterns": [
796
{
797
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
798
"name": "punctuation.separator.constant.numeric.go"
799
}
800
]
801
},
802
"20": {
803
"name": "punctuation.separator.constant.numeric.go"
804
},
805
"21": {
806
"name": "keyword.other.unit.exponent.decimal.go"
807
},
808
"22": {
809
"name": "keyword.operator.plus.exponent.decimal.go"
810
},
811
"23": {
812
"name": "keyword.operator.minus.exponent.decimal.go"
813
},
814
"24": {
815
"name": "constant.numeric.exponent.decimal.go",
816
"patterns": [
817
{
818
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
819
"name": "punctuation.separator.constant.numeric.go"
820
}
821
]
822
},
823
"25": {
824
"name": "keyword.other.unit.imaginary.go"
825
},
826
"26": {
827
"name": "keyword.other.unit.hexadecimal.go"
828
},
829
"27": {
830
"name": "constant.numeric.hexadecimal.go",
831
"patterns": [
832
{
833
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
834
"name": "punctuation.separator.constant.numeric.go"
835
}
836
]
837
},
838
"28": {
839
"name": "punctuation.separator.constant.numeric.go"
840
},
841
"29": {
842
"name": "constant.numeric.hexadecimal.go"
843
},
844
"30": {
845
"name": "constant.numeric.hexadecimal.go",
846
"patterns": [
847
{
848
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
849
"name": "punctuation.separator.constant.numeric.go"
850
}
851
]
852
},
853
"31": {
854
"name": "punctuation.separator.constant.numeric.go"
855
},
856
"32": {
857
"name": "keyword.other.unit.exponent.hexadecimal.go"
858
},
859
"33": {
860
"name": "keyword.operator.plus.exponent.hexadecimal.go"
861
},
862
"34": {
863
"name": "keyword.operator.minus.exponent.hexadecimal.go"
864
},
865
"35": {
866
"name": "constant.numeric.exponent.hexadecimal.go",
867
"patterns": [
868
{
869
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
870
"name": "punctuation.separator.constant.numeric.go"
871
}
872
]
873
},
874
"36": {
875
"name": "keyword.other.unit.imaginary.go"
876
},
877
"37": {
878
"name": "keyword.other.unit.hexadecimal.go"
879
},
880
"38": {
881
"name": "constant.numeric.hexadecimal.go",
882
"patterns": [
883
{
884
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
885
"name": "punctuation.separator.constant.numeric.go"
886
}
887
]
888
},
889
"39": {
890
"name": "punctuation.separator.constant.numeric.go"
891
},
892
"40": {
893
"name": "keyword.other.unit.exponent.hexadecimal.go"
894
},
895
"41": {
896
"name": "keyword.operator.plus.exponent.hexadecimal.go"
897
},
898
"42": {
899
"name": "keyword.operator.minus.exponent.hexadecimal.go"
900
},
901
"43": {
902
"name": "constant.numeric.exponent.hexadecimal.go",
903
"patterns": [
904
{
905
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
906
"name": "punctuation.separator.constant.numeric.go"
907
}
908
]
909
},
910
"44": {
911
"name": "keyword.other.unit.imaginary.go"
912
},
913
"45": {
914
"name": "keyword.other.unit.hexadecimal.go"
915
},
916
"46": {
917
"name": "constant.numeric.hexadecimal.go"
918
},
919
"47": {
920
"name": "constant.numeric.hexadecimal.go",
921
"patterns": [
922
{
923
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
924
"name": "punctuation.separator.constant.numeric.go"
925
}
926
]
927
},
928
"48": {
929
"name": "punctuation.separator.constant.numeric.go"
930
},
931
"49": {
932
"name": "keyword.other.unit.exponent.hexadecimal.go"
933
},
934
"50": {
935
"name": "keyword.operator.plus.exponent.hexadecimal.go"
936
},
937
"51": {
938
"name": "keyword.operator.minus.exponent.hexadecimal.go"
939
},
940
"52": {
941
"name": "constant.numeric.exponent.hexadecimal.go",
942
"patterns": [
943
{
944
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
945
"name": "punctuation.separator.constant.numeric.go"
946
}
947
]
948
},
949
"53": {
950
"name": "keyword.other.unit.imaginary.go"
951
}
952
}
953
},
954
{
955
"match": "(?:(?:(?:\\G(?=[0-9.])(?!0[xXbBoO])([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(i(?!\\w))?(?:\\n|$)|(\\G0[bB])_?([01](?:[01]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(i(?!\\w))?(?:\\n|$))|(\\G0[oO]?)_?((?:[0-7]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))+)(i(?!\\w))?(?:\\n|$))|(\\G0[xX])_?([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(i(?!\\w))?(?:\\n|$))",
956
"captures": {
957
"1": {
958
"name": "constant.numeric.decimal.go",
959
"patterns": [
960
{
961
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
962
"name": "punctuation.separator.constant.numeric.go"
963
}
964
]
965
},
966
"2": {
967
"name": "punctuation.separator.constant.numeric.go"
968
},
969
"3": {
970
"name": "keyword.other.unit.imaginary.go"
971
},
972
"4": {
973
"name": "keyword.other.unit.binary.go"
974
},
975
"5": {
976
"name": "constant.numeric.binary.go",
977
"patterns": [
978
{
979
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
980
"name": "punctuation.separator.constant.numeric.go"
981
}
982
]
983
},
984
"6": {
985
"name": "punctuation.separator.constant.numeric.go"
986
},
987
"7": {
988
"name": "keyword.other.unit.imaginary.go"
989
},
990
"8": {
991
"name": "keyword.other.unit.octal.go"
992
},
993
"9": {
994
"name": "constant.numeric.octal.go",
995
"patterns": [
996
{
997
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
998
"name": "punctuation.separator.constant.numeric.go"
999
}
1000
]
1001
},
1002
"10": {
1003
"name": "punctuation.separator.constant.numeric.go"
1004
},
1005
"11": {
1006
"name": "keyword.other.unit.imaginary.go"
1007
},
1008
"12": {
1009
"name": "keyword.other.unit.hexadecimal.go"
1010
},
1011
"13": {
1012
"name": "constant.numeric.hexadecimal.go",
1013
"patterns": [
1014
{
1015
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
1016
"name": "punctuation.separator.constant.numeric.go"
1017
}
1018
]
1019
},
1020
"14": {
1021
"name": "punctuation.separator.constant.numeric.go"
1022
},
1023
"15": {
1024
"name": "keyword.other.unit.imaginary.go"
1025
}
1026
}
1027
},
1028
{
1029
"match": "(?:(?:[0-9a-zA-Z_\\.])|(?<=[eEpP])[+-])+",
1030
"name": "invalid.illegal.constant.numeric.go"
1031
}
1032
]
1033
}
1034
]
1035
}
1036
}
1037
},
1038
"terminators": {
1039
"comment": "Terminators",
1040
"match": ";",
1041
"name": "punctuation.terminator.go"
1042
},
1043
"package_name": {
1044
"patterns": [
1045
{
1046
"comment": "package name",
1047
"begin": "\\b(package)\\s+",
1048
"beginCaptures": {
1049
"1": {
1050
"name": "keyword.package.go"
1051
}
1052
},
1053
"end": "(?!\\G)",
1054
"patterns": [
1055
{
1056
"match": "\\d\\w*",
1057
"name": "invalid.illegal.identifier.go"
1058
},
1059
{
1060
"match": "\\w+",
1061
"name": "entity.name.type.package.go"
1062
}
1063
]
1064
}
1065
]
1066
},
1067
"import": {
1068
"comment": "import",
1069
"patterns": [
1070
{
1071
"comment": "import",
1072
"begin": "\\b(import)\\s+",
1073
"beginCaptures": {
1074
"1": {
1075
"name": "keyword.control.import.go"
1076
}
1077
},
1078
"end": "(?!\\G)",
1079
"patterns": [
1080
{
1081
"include": "#imports"
1082
}
1083
]
1084
}
1085
]
1086
},
1087
"imports": {
1088
"comment": "import package(s)",
1089
"patterns": [
1090
{
1091
"match": "(\\s*[\\w\\.]+)?\\s*((\")([^\"]*)(\"))",
1092
"captures": {
1093
"1": {
1094
"patterns": [
1095
{
1096
"include": "#delimiters"
1097
},
1098
{
1099
"match": "\\w+",
1100
"name": "variable.other.import.go"
1101
}
1102
]
1103
},
1104
"2": {
1105
"name": "string.quoted.double.go"
1106
},
1107
"3": {
1108
"name": "punctuation.definition.string.begin.go"
1109
},
1110
"4": {
1111
"name": "entity.name.import.go"
1112
},
1113
"5": {
1114
"name": "punctuation.definition.string.end.go"
1115
}
1116
}
1117
},
1118
{
1119
"begin": "\\(",
1120
"beginCaptures": {
1121
"0": {
1122
"name": "punctuation.definition.imports.begin.bracket.round.go"
1123
}
1124
},
1125
"end": "\\)",
1126
"endCaptures": {
1127
"0": {
1128
"name": "punctuation.definition.imports.end.bracket.round.go"
1129
}
1130
},
1131
"patterns": [
1132
{
1133
"include": "#comments"
1134
},
1135
{
1136
"include": "#imports"
1137
}
1138
]
1139
},
1140
{
1141
"include": "$self"
1142
}
1143
]
1144
},
1145
"function_declaration": {
1146
"comment": "Function declarations",
1147
"begin": "(?:^(\\bfunc\\b)(?:\\s*(\\([^\\)]+\\)\\s*)?(?:(\\w+)(?=\\(|\\[))?))",
1148
"beginCaptures": {
1149
"1": {
1150
"name": "keyword.function.go"
1151
},
1152
"2": {
1153
"patterns": [
1154
{
1155
"begin": "\\(",
1156
"beginCaptures": {
1157
"0": {
1158
"name": "punctuation.definition.begin.bracket.round.go"
1159
}
1160
},
1161
"end": "\\)",
1162
"endCaptures": {
1163
"0": {
1164
"name": "punctuation.definition.end.bracket.round.go"
1165
}
1166
},
1167
"patterns": [
1168
{
1169
"match": "(?:(\\w+(?:\\s+))?((?:[\\w\\.\\*]+)(?:\\[(?:(?:(?:[\\w\\.\\*]+)(?:\\,\\s+)?)+)?\\])?))",
1170
"captures": {
1171
"1": {
1172
"name": "variable.parameter.go"
1173
},
1174
"2": {
1175
"patterns": [
1176
{
1177
"include": "#type-declarations-without-brackets"
1178
},
1179
{
1180
"include": "#parameter-variable-types"
1181
},
1182
{
1183
"match": "\\w+",
1184
"name": "entity.name.type.go"
1185
}
1186
]
1187
}
1188
}
1189
},
1190
{
1191
"include": "$self"
1192
}
1193
]
1194
}
1195
]
1196
},
1197
"3": {
1198
"patterns": [
1199
{
1200
"match": "\\d\\w*",
1201
"name": "invalid.illegal.identifier.go"
1202
},
1203
{
1204
"match": "\\w+",
1205
"name": "entity.name.function.go"
1206
}
1207
]
1208
}
1209
},
1210
"end": "(?:(?<=\\))\\s*((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?!(?:[\\[\\]\\*]+)?(?:\\bstruct\\b|\\binterface\\b))[\\w\\.\\-\\*\\[\\]]+)?\\s*(?=\\{))",
1211
"endCaptures": {
1212
"1": {
1213
"patterns": [
1214
{
1215
"include": "#type-declarations-without-brackets"
1216
},
1217
{
1218
"include": "#parameter-variable-types"
1219
},
1220
{
1221
"match": "\\w+",
1222
"name": "entity.name.type.go"
1223
}
1224
]
1225
}
1226
},
1227
"patterns": [
1228
{
1229
"begin": "\\(",
1230
"beginCaptures": {
1231
"0": {
1232
"name": "punctuation.definition.begin.bracket.round.go"
1233
}
1234
},
1235
"end": "\\)",
1236
"endCaptures": {
1237
"0": {
1238
"name": "punctuation.definition.end.bracket.round.go"
1239
}
1240
},
1241
"patterns": [
1242
{
1243
"include": "#function_param_types"
1244
}
1245
]
1246
},
1247
{
1248
"begin": "([\\w\\.\\*]+)?(\\[)",
1249
"beginCaptures": {
1250
"1": {
1251
"patterns": [
1252
{
1253
"include": "#type-declarations"
1254
},
1255
{
1256
"match": "\\w+",
1257
"name": "entity.name.type.go"
1258
}
1259
]
1260
},
1261
"2": {
1262
"name": "punctuation.definition.begin.bracket.square.go"
1263
}
1264
},
1265
"end": "\\]",
1266
"endCaptures": {
1267
"0": {
1268
"name": "punctuation.definition.end.bracket.square.go"
1269
}
1270
},
1271
"patterns": [
1272
{
1273
"include": "#generic_param_types"
1274
}
1275
]
1276
},
1277
{
1278
"comment": "single function as a type returned type(s) declaration",
1279
"match": "(?:(?<=\\))(?:\\s*)((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?[\\w\\*\\.\\[\\]\\<\\>\\-]+(?:\\s*)(?:\\/(?:\\/|\\*).*)?)$)",
1280
"captures": {
1281
"1": {
1282
"patterns": [
1283
{
1284
"include": "#type-declarations-without-brackets"
1285
},
1286
{
1287
"include": "#parameter-variable-types"
1288
},
1289
{
1290
"match": "\\w+",
1291
"name": "entity.name.type.go"
1292
}
1293
]
1294
}
1295
}
1296
},
1297
{
1298
"include": "$self"
1299
}
1300
]
1301
},
1302
"function_param_types": {
1303
"comment": "function parameter variables and types",
1304
"patterns": [
1305
{
1306
"include": "#struct_variables_types"
1307
},
1308
{
1309
"include": "#interface_variables_types"
1310
},
1311
{
1312
"include": "#type-declarations-without-brackets"
1313
},
1314
{
1315
"comment": "struct/interface type declaration",
1316
"match": "((?:(?:\\b\\w+\\,\\s*)+)?\\b\\w+)\\s+(?=(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[\\[\\]\\*]+)?\\b(?:struct|interface)\\b\\s*\\{)",
1317
"captures": {
1318
"1": {
1319
"patterns": [
1320
{
1321
"include": "#type-declarations"
1322
},
1323
{
1324
"match": "\\w+",
1325
"name": "variable.parameter.go"
1326
}
1327
]
1328
}
1329
}
1330
},
1331
{
1332
"comment": "multiple parameters one type -with multilines",
1333
"match": "(?:(?:(?<=\\()|^\\s*)((?:(?:\\b\\w+\\,\\s*)+)(?:/(?:/|\\*).*)?)$)",
1334
"captures": {
1335
"1": {
1336
"patterns": [
1337
{
1338
"include": "#type-declarations"
1339
},
1340
{
1341
"match": "\\w+",
1342
"name": "variable.parameter.go"
1343
}
1344
]
1345
}
1346
}
1347
},
1348
{
1349
"comment": "multiple params and types | multiple params one type | one param one type",
1350
"match": "(?:((?:(?:\\b\\w+\\,\\s*)+)?\\b\\w+)(?:\\s+)((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:(?:(?:[\\w\\[\\]\\.\\*]+)?(?:(?:\\bfunc\\b\\((?:[^\\)]+)?\\))(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:\\s*))+(?:(?:(?:[\\w\\*\\.\\[\\]]+)|(?:\\((?:[^\\)]+)?\\))))?)|(?:(?:[\\[\\]\\*]+)?[\\w\\*\\.]+(?:\\[(?:[^\\]]+)\\])?(?:[\\w\\.\\*]+)?)+)))",
1351
"captures": {
1352
"1": {
1353
"patterns": [
1354
{
1355
"include": "#delimiters"
1356
},
1357
{
1358
"match": "\\w+",
1359
"name": "variable.parameter.go"
1360
}
1361
]
1362
},
1363
"2": {
1364
"patterns": [
1365
{
1366
"include": "#type-declarations-without-brackets"
1367
},
1368
{
1369
"include": "#parameter-variable-types"
1370
},
1371
{
1372
"match": "\\w+",
1373
"name": "entity.name.type.go"
1374
}
1375
]
1376
}
1377
}
1378
},
1379
{
1380
"begin": "([\\w\\.\\*]+)?(\\[)",
1381
"beginCaptures": {
1382
"1": {
1383
"patterns": [
1384
{
1385
"include": "#type-declarations"
1386
},
1387
{
1388
"match": "\\w+",
1389
"name": "entity.name.type.go"
1390
}
1391
]
1392
},
1393
"2": {
1394
"name": "punctuation.definition.begin.bracket.square.go"
1395
}
1396
},
1397
"end": "\\]",
1398
"endCaptures": {
1399
"0": {
1400
"name": "punctuation.definition.end.bracket.square.go"
1401
}
1402
},
1403
"patterns": [
1404
{
1405
"include": "#generic_param_types"
1406
}
1407
]
1408
},
1409
{
1410
"begin": "\\(",
1411
"beginCaptures": {
1412
"0": {
1413
"name": "punctuation.definition.begin.bracket.round.go"
1414
}
1415
},
1416
"end": "\\)",
1417
"endCaptures": {
1418
"0": {
1419
"name": "punctuation.definition.end.bracket.round.go"
1420
}
1421
},
1422
"patterns": [
1423
{
1424
"include": "#function_param_types"
1425
}
1426
]
1427
},
1428
{
1429
"comment": "other types",
1430
"match": "([\\w\\.]+)",
1431
"captures": {
1432
"1": {
1433
"patterns": [
1434
{
1435
"include": "#type-declarations"
1436
},
1437
{
1438
"match": "\\w+",
1439
"name": "entity.name.type.go"
1440
}
1441
]
1442
}
1443
}
1444
},
1445
{
1446
"include": "$self"
1447
}
1448
]
1449
},
1450
"generic_param_types": {
1451
"comment": "generic parameter variables and types",
1452
"patterns": [
1453
{
1454
"include": "#struct_variables_types"
1455
},
1456
{
1457
"include": "#interface_variables_types"
1458
},
1459
{
1460
"include": "#type-declarations-without-brackets"
1461
},
1462
{
1463
"comment": "struct/interface type declaration",
1464
"match": "((?:(?:\\b\\w+\\,\\s*)+)?\\b\\w+)\\s+(?=(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[\\[\\]\\*]+)?\\b(?:struct|interface)\\b\\s*\\{)",
1465
"captures": {
1466
"1": {
1467
"patterns": [
1468
{
1469
"include": "#type-declarations"
1470
},
1471
{
1472
"match": "\\w+",
1473
"name": "variable.parameter.go"
1474
}
1475
]
1476
}
1477
}
1478
},
1479
{
1480
"comment": "multiple parameters one type -with multilines",
1481
"match": "(?:(?:(?<=\\()|^\\s*)((?:(?:\\b\\w+\\,\\s*)+)(?:/(?:/|\\*).*)?)$)",
1482
"captures": {
1483
"1": {
1484
"patterns": [
1485
{
1486
"include": "#type-declarations"
1487
},
1488
{
1489
"match": "\\w+",
1490
"name": "variable.parameter.go"
1491
}
1492
]
1493
}
1494
}
1495
},
1496
{
1497
"comment": "multiple params and types | multiple types one param",
1498
"match": "(?:((?:(?:\\b\\w+\\,\\s*)+)?\\b\\w+)(?:\\s+)((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:(?:(?:[\\w\\[\\]\\.\\*]+)?(?:(?:\\bfunc\\b\\((?:[^\\)]+)?\\))(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:\\s*))+(?:(?:(?:[\\w\\*\\.]+)|(?:\\((?:[^\\)]+)?\\))))?)|(?:(?:(?:[\\w\\*\\.\\~]+)|(?:\\[(?:(?:[\\w\\.\\*]+)?(?:\\[(?:[^\\]]+)?\\])?(?:\\,\\s+)?)+\\]))(?:[\\w\\.\\*]+)?)+)))",
1499
"captures": {
1500
"1": {
1501
"patterns": [
1502
{
1503
"include": "#delimiters"
1504
},
1505
{
1506
"match": "\\w+",
1507
"name": "variable.parameter.go"
1508
}
1509
]
1510
},
1511
"2": {
1512
"patterns": [
1513
{
1514
"include": "#type-declarations-without-brackets"
1515
},
1516
{
1517
"include": "#parameter-variable-types"
1518
},
1519
{
1520
"match": "\\w+",
1521
"name": "entity.name.type.go"
1522
}
1523
]
1524
},
1525
"3": {
1526
"patterns": [
1527
{
1528
"include": "#type-declarations"
1529
},
1530
{
1531
"match": "\\w+",
1532
"name": "entity.name.type.go"
1533
}
1534
]
1535
}
1536
}
1537
},
1538
{
1539
"begin": "([\\w\\.\\*]+)?(\\[)",
1540
"beginCaptures": {
1541
"1": {
1542
"patterns": [
1543
{
1544
"include": "#type-declarations"
1545
},
1546
{
1547
"match": "\\w+",
1548
"name": "entity.name.type.go"
1549
}
1550
]
1551
},
1552
"2": {
1553
"name": "punctuation.definition.begin.bracket.square.go"
1554
}
1555
},
1556
"end": "\\]",
1557
"endCaptures": {
1558
"0": {
1559
"name": "punctuation.definition.end.bracket.square.go"
1560
}
1561
},
1562
"patterns": [
1563
{
1564
"include": "#generic_param_types"
1565
}
1566
]
1567
},
1568
{
1569
"begin": "\\(",
1570
"beginCaptures": {
1571
"0": {
1572
"name": "punctuation.definition.begin.bracket.round.go"
1573
}
1574
},
1575
"end": "\\)",
1576
"endCaptures": {
1577
"0": {
1578
"name": "punctuation.definition.end.bracket.round.go"
1579
}
1580
},
1581
"patterns": [
1582
{
1583
"include": "#function_param_types"
1584
}
1585
]
1586
},
1587
{
1588
"comment": "other types",
1589
"match": "\\b([\\w\\.]+)",
1590
"captures": {
1591
"1": {
1592
"patterns": [
1593
{
1594
"include": "#type-declarations"
1595
},
1596
{
1597
"match": "\\w+",
1598
"name": "entity.name.type.go"
1599
}
1600
]
1601
}
1602
}
1603
},
1604
{
1605
"include": "$self"
1606
}
1607
]
1608
},
1609
"functions": {
1610
"comment": "Functions",
1611
"begin": "(\\bfunc\\b)(?=\\()",
1612
"beginCaptures": {
1613
"1": {
1614
"name": "keyword.function.go"
1615
}
1616
},
1617
"end": "(?:(?<=\\))(\\s*(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?((?:(?:\\s*(?:(?:[\\[\\]\\*]+)?[\\w\\.\\*]+)?(?:(?:\\[(?:(?:[\\w\\.\\*]+)?(?:\\[(?:[^\\]]+)?\\])?(?:\\,\\s+)?)+\\])|(?:\\((?:[^\\)]+)?\\)))?(?:[\\w\\.\\*]+)?)(?:\\s*)(?=\\{))|(?:\\s*(?:(?:(?:[\\[\\]\\*]+)?(?!\\bfunc\\b)(?:[\\w\\.\\*]+)(?:\\[(?:(?:[\\w\\.\\*]+)?(?:\\[(?:[^\\]]+)?\\])?(?:\\,\\s+)?)+\\])?(?:[\\w\\.\\*]+)?)|(?:\\((?:[^\\)]+)?\\)))))?)",
1618
"endCaptures": {
1619
"1": {
1620
"patterns": [
1621
{
1622
"include": "#type-declarations"
1623
}
1624
]
1625
},
1626
"2": {
1627
"patterns": [
1628
{
1629
"include": "#type-declarations-without-brackets"
1630
},
1631
{
1632
"include": "#parameter-variable-types"
1633
},
1634
{
1635
"match": "\\w+",
1636
"name": "entity.name.type.go"
1637
}
1638
]
1639
}
1640
},
1641
"patterns": [
1642
{
1643
"include": "#parameter-variable-types"
1644
}
1645
]
1646
},
1647
"functions_inline": {
1648
"comment": "functions in-line with multi return types",
1649
"match": "(?:(\\bfunc\\b)((?:\\((?:[^/]*?)\\))(?:\\s+)(?:\\((?:[^/]*?)\\)))(?:\\s+)(?=\\{))",
1650
"captures": {
1651
"1": {
1652
"name": "keyword.function.go"
1653
},
1654
"2": {
1655
"patterns": [
1656
{
1657
"include": "#type-declarations-without-brackets"
1658
},
1659
{
1660
"begin": "\\(",
1661
"beginCaptures": {
1662
"0": {
1663
"name": "punctuation.definition.begin.bracket.round.go"
1664
}
1665
},
1666
"end": "\\)",
1667
"endCaptures": {
1668
"0": {
1669
"name": "punctuation.definition.end.bracket.round.go"
1670
}
1671
},
1672
"patterns": [
1673
{
1674
"include": "#function_param_types"
1675
},
1676
{
1677
"include": "$self"
1678
}
1679
]
1680
},
1681
{
1682
"match": "\\[",
1683
"name": "punctuation.definition.begin.bracket.square.go"
1684
},
1685
{
1686
"match": "\\]",
1687
"name": "punctuation.definition.end.bracket.square.go"
1688
},
1689
{
1690
"match": "\\{",
1691
"name": "punctuation.definition.begin.bracket.curly.go"
1692
},
1693
{
1694
"match": "\\}",
1695
"name": "punctuation.definition.end.bracket.curly.go"
1696
},
1697
{
1698
"match": "\\w+",
1699
"name": "entity.name.type.go"
1700
}
1701
]
1702
}
1703
}
1704
},
1705
"support_functions": {
1706
"comment": "Support Functions",
1707
"match": "(?:(?:((?<=\\.)\\b\\w+)|(\\b\\w+))(?<brackets>\\[(?:[^\\[\\]]|\\g<brackets>)*\\])?(?=\\())",
1708
"captures": {
1709
"1": {
1710
"name": "entity.name.function.support.go"
1711
},
1712
"2": {
1713
"patterns": [
1714
{
1715
"include": "#type-declarations"
1716
},
1717
{
1718
"match": "\\d\\w*",
1719
"name": "invalid.illegal.identifier.go"
1720
},
1721
{
1722
"match": "\\w+",
1723
"name": "entity.name.function.support.go"
1724
}
1725
]
1726
},
1727
"3": {
1728
"patterns": [
1729
{
1730
"include": "#type-declarations-without-brackets"
1731
},
1732
{
1733
"match": "\\[",
1734
"name": "punctuation.definition.begin.bracket.square.go"
1735
},
1736
{
1737
"match": "\\]",
1738
"name": "punctuation.definition.end.bracket.square.go"
1739
},
1740
{
1741
"match": "\\{",
1742
"name": "punctuation.definition.begin.bracket.curly.go"
1743
},
1744
{
1745
"match": "\\}",
1746
"name": "punctuation.definition.end.bracket.curly.go"
1747
},
1748
{
1749
"match": "\\w+",
1750
"name": "entity.name.type.go"
1751
}
1752
]
1753
}
1754
}
1755
},
1756
"other_struct_interface_expressions": {
1757
"comment": "struct and interface expression in-line (before curly bracket)",
1758
"patterns": [
1759
{
1760
"comment": "after control variables must be added exactly here, do not move it! (changing may not affect tests, so be careful!)",
1761
"include": "#after_control_variables"
1762
},
1763
{
1764
"comment": "uses a named group to recursively match generic type with nested brackets, like 'Foo[A[B, C]]{}'",
1765
"match": "\\b(?!struct\\b|interface\\b)([\\w\\.]+)(?<brackets>\\[(?:[^\\[\\]]|\\g<brackets>)*\\])?(?=\\{)",
1766
"captures": {
1767
"1": {
1768
"patterns": [
1769
{
1770
"include": "#type-declarations"
1771
},
1772
{
1773
"match": "\\w+",
1774
"name": "entity.name.type.go"
1775
}
1776
]
1777
},
1778
"2": {
1779
"patterns": [
1780
{
1781
"include": "#type-declarations-without-brackets"
1782
},
1783
{
1784
"match": "\\[",
1785
"name": "punctuation.definition.begin.bracket.square.go"
1786
},
1787
{
1788
"match": "\\]",
1789
"name": "punctuation.definition.end.bracket.square.go"
1790
},
1791
{
1792
"match": "\\{",
1793
"name": "punctuation.definition.begin.bracket.curly.go"
1794
},
1795
{
1796
"match": "\\}",
1797
"name": "punctuation.definition.end.bracket.curly.go"
1798
},
1799
{
1800
"match": "\\w+",
1801
"name": "entity.name.type.go"
1802
}
1803
]
1804
}
1805
}
1806
}
1807
]
1808
},
1809
"type_assertion_inline": {
1810
"comment": "struct/interface types in-line (type assertion) | switch type keyword",
1811
"match": "(?:(?<=\\.\\()(?:(\\btype\\b)|((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[\\[\\]\\*]+)?(?:[\\w\\.]+)(?:\\[(?:(?:[\\w\\.\\*\\[\\]\\{\\}]+)(?:(?:\\,\\s*(?:[\\w\\.\\*\\[\\]\\{\\}]+))*))?\\])?))(?=\\)))",
1812
"captures": {
1813
"1": {
1814
"name": "keyword.type.go"
1815
},
1816
"2": {
1817
"patterns": [
1818
{
1819
"include": "#type-declarations-without-brackets"
1820
},
1821
{
1822
"match": "\\(",
1823
"name": "punctuation.definition.begin.bracket.round.go"
1824
},
1825
{
1826
"match": "\\)",
1827
"name": "punctuation.definition.end.bracket.round.go"
1828
},
1829
{
1830
"match": "\\[",
1831
"name": "punctuation.definition.begin.bracket.square.go"
1832
},
1833
{
1834
"match": "\\]",
1835
"name": "punctuation.definition.end.bracket.square.go"
1836
},
1837
{
1838
"match": "\\{",
1839
"name": "punctuation.definition.begin.bracket.curly.go"
1840
},
1841
{
1842
"match": "\\}",
1843
"name": "punctuation.definition.end.bracket.curly.go"
1844
},
1845
{
1846
"match": "\\w+",
1847
"name": "entity.name.type.go"
1848
}
1849
]
1850
}
1851
}
1852
},
1853
"struct_variables_types": {
1854
"comment": "Struct variable type",
1855
"begin": "(\\bstruct\\b)\\s*(\\{)",
1856
"beginCaptures": {
1857
"1": {
1858
"name": "keyword.struct.go"
1859
},
1860
"2": {
1861
"name": "punctuation.definition.begin.bracket.curly.go"
1862
}
1863
},
1864
"patterns": [
1865
{
1866
"include": "#struct_variables_types_fields"
1867
},
1868
{
1869
"include": "$self"
1870
}
1871
],
1872
"end": "\\}",
1873
"endCaptures": {
1874
"0": {
1875
"name": "punctuation.definition.end.bracket.curly.go"
1876
}
1877
}
1878
},
1879
"struct_variables_types_fields": {
1880
"comment": "Struct variable type fields",
1881
"patterns": [
1882
{
1883
"include": "#struct_variable_types_fields_multi"
1884
},
1885
{
1886
"comment": "one line - single type",
1887
"match": "(?:(?<=\\{)\\s*((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[\\w\\.\\*\\[\\]]+))\\s*(?=\\}))",
1888
"captures": {
1889
"1": {
1890
"patterns": [
1891
{
1892
"include": "#type-declarations"
1893
},
1894
{
1895
"match": "\\w+",
1896
"name": "entity.name.type.go"
1897
}
1898
]
1899
}
1900
}
1901
},
1902
{
1903
"comment": "one line - property variables and types",
1904
"match": "(?:(?<=\\{)\\s*((?:(?:\\w+\\,\\s*)+)?(?:\\w+\\s+))((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[\\w\\.\\*\\[\\]]+))\\s*(?=\\}))",
1905
"captures": {
1906
"1": {
1907
"patterns": [
1908
{
1909
"include": "#type-declarations"
1910
},
1911
{
1912
"match": "\\w+",
1913
"name": "variable.other.property.go"
1914
}
1915
]
1916
},
1917
"2": {
1918
"patterns": [
1919
{
1920
"include": "#type-declarations"
1921
},
1922
{
1923
"match": "\\w+",
1924
"name": "entity.name.type.go"
1925
}
1926
]
1927
}
1928
}
1929
},
1930
{
1931
"comment": "one line with semicolon(;) without formatting gofmt - single type | property variables and types",
1932
"match": "(?:(?<=\\{)((?:\\s*(?:(?:(?:\\w+\\,\\s*)+)?(?:\\w+\\s+))?(?:(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[^\\s/]+)(?:\\;)?))+)\\s*(?=\\}))",
1933
"captures": {
1934
"1": {
1935
"patterns": [
1936
{
1937
"match": "(?:((?:(?:\\w+\\,\\s*)+)?(?:\\w+\\s+))?((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[^\\s/]+)(?:\\;)?))",
1938
"captures": {
1939
"1": {
1940
"patterns": [
1941
{
1942
"include": "#type-declarations"
1943
},
1944
{
1945
"match": "\\w+",
1946
"name": "variable.other.property.go"
1947
}
1948
]
1949
},
1950
"2": {
1951
"patterns": [
1952
{
1953
"include": "#type-declarations"
1954
},
1955
{
1956
"match": "\\w+",
1957
"name": "entity.name.type.go"
1958
}
1959
]
1960
}
1961
}
1962
}
1963
]
1964
}
1965
}
1966
},
1967
{
1968
"comment": "one type only",
1969
"match": "(?:((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[\\w\\.\\*]+)\\s*)(?:(?=\\`|\\/|\")|$))",
1970
"captures": {
1971
"1": {
1972
"patterns": [
1973
{
1974
"include": "#type-declarations"
1975
},
1976
{
1977
"match": "\\w+",
1978
"name": "entity.name.type.go"
1979
}
1980
]
1981
}
1982
}
1983
},
1984
{
1985
"comment": "property variables and types",
1986
"match": "(\\b\\w+(?:\\s*\\,\\s*\\b\\w+)*)\\s*([^\\`\"\\/]+)",
1987
"captures": {
1988
"1": {
1989
"patterns": [
1990
{
1991
"include": "#type-declarations"
1992
},
1993
{
1994
"match": "\\w+",
1995
"name": "variable.other.property.go"
1996
}
1997
]
1998
},
1999
"2": {
2000
"patterns": [
2001
{
2002
"include": "#type-declarations-without-brackets"
2003
},
2004
{
2005
"include": "#parameter-variable-types"
2006
},
2007
{
2008
"match": "\\w+",
2009
"name": "entity.name.type.go"
2010
}
2011
]
2012
}
2013
}
2014
}
2015
]
2016
},
2017
"struct_variable_types_fields_multi": {
2018
"comment": "struct variable and type fields with multi lines",
2019
"patterns": [
2020
{
2021
"comment": "struct in struct types",
2022
"begin": "(?:((?:\\b\\w+(?:\\,\\s*\\b\\w+)*)(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:\\s*)(?:[\\[\\]\\*]+)?)(\\bstruct\\b)(?:\\s*)(\\{))",
2023
"beginCaptures": {
2024
"1": {
2025
"patterns": [
2026
{
2027
"include": "#type-declarations"
2028
},
2029
{
2030
"match": "\\w+",
2031
"name": "variable.other.property.go"
2032
}
2033
]
2034
},
2035
"2": {
2036
"name": "keyword.struct.go"
2037
},
2038
"3": {
2039
"name": "punctuation.definition.begin.bracket.curly.go"
2040
}
2041
},
2042
"end": "\\}",
2043
"endCaptures": {
2044
"0": {
2045
"name": "punctuation.definition.end.bracket.curly.go"
2046
}
2047
},
2048
"patterns": [
2049
{
2050
"include": "#struct_variables_types_fields"
2051
},
2052
{
2053
"include": "$self"
2054
}
2055
]
2056
},
2057
{
2058
"comment": "interface in struct types",
2059
"begin": "(?:((?:\\b\\w+(?:\\,\\s*\\b\\w+)*)(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:\\s*)(?:[\\[\\]\\*]+)?)(\\binterface\\b)(?:\\s*)(\\{))",
2060
"beginCaptures": {
2061
"1": {
2062
"patterns": [
2063
{
2064
"include": "#type-declarations"
2065
},
2066
{
2067
"match": "\\w+",
2068
"name": "variable.other.property.go"
2069
}
2070
]
2071
},
2072
"2": {
2073
"name": "keyword.interface.go"
2074
},
2075
"3": {
2076
"name": "punctuation.definition.begin.bracket.curly.go"
2077
}
2078
},
2079
"end": "\\}",
2080
"endCaptures": {
2081
"0": {
2082
"name": "punctuation.definition.end.bracket.curly.go"
2083
}
2084
},
2085
"patterns": [
2086
{
2087
"include": "#interface_variables_types_field"
2088
},
2089
{
2090
"include": "$self"
2091
}
2092
]
2093
},
2094
{
2095
"comment": "function in struct types",
2096
"begin": "(?:((?:\\b\\w+(?:\\,\\s*\\b\\w+)*)(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:\\s*)(?:[\\[\\]\\*]+)?)(\\bfunc\\b)(?:\\s*)(\\())",
2097
"beginCaptures": {
2098
"1": {
2099
"patterns": [
2100
{
2101
"include": "#type-declarations"
2102
},
2103
{
2104
"match": "\\w+",
2105
"name": "variable.other.property.go"
2106
}
2107
]
2108
},
2109
"2": {
2110
"name": "keyword.function.go"
2111
},
2112
"3": {
2113
"name": "punctuation.definition.begin.bracket.round.go"
2114
}
2115
},
2116
"end": "\\)",
2117
"endCaptures": {
2118
"0": {
2119
"name": "punctuation.definition.end.bracket.round.go"
2120
}
2121
},
2122
"patterns": [
2123
{
2124
"include": "#function_param_types"
2125
},
2126
{
2127
"include": "$self"
2128
}
2129
]
2130
},
2131
{
2132
"include": "#parameter-variable-types"
2133
}
2134
]
2135
},
2136
"interface_variables_types": {
2137
"comment": "interface variable types",
2138
"begin": "(\\binterface\\b)\\s*(\\{)",
2139
"beginCaptures": {
2140
"1": {
2141
"name": "keyword.interface.go"
2142
},
2143
"2": {
2144
"name": "punctuation.definition.begin.bracket.curly.go"
2145
}
2146
},
2147
"patterns": [
2148
{
2149
"include": "#interface_variables_types_field"
2150
},
2151
{
2152
"include": "$self"
2153
}
2154
],
2155
"end": "\\}",
2156
"endCaptures": {
2157
"0": {
2158
"name": "punctuation.definition.end.bracket.curly.go"
2159
}
2160
}
2161
},
2162
"interface_variables_types_field": {
2163
"comment": "interface variable type fields",
2164
"patterns": [
2165
{
2166
"include": "#support_functions"
2167
},
2168
{
2169
"include": "#type-declarations-without-brackets"
2170
},
2171
{
2172
"begin": "([\\w\\.\\*]+)?(\\[)",
2173
"beginCaptures": {
2174
"1": {
2175
"patterns": [
2176
{
2177
"include": "#type-declarations"
2178
},
2179
{
2180
"match": "\\w+",
2181
"name": "entity.name.type.go"
2182
}
2183
]
2184
},
2185
"2": {
2186
"name": "punctuation.definition.begin.bracket.square.go"
2187
}
2188
},
2189
"end": "\\]",
2190
"endCaptures": {
2191
"0": {
2192
"name": "punctuation.definition.end.bracket.square.go"
2193
}
2194
},
2195
"patterns": [
2196
{
2197
"include": "#generic_param_types"
2198
}
2199
]
2200
},
2201
{
2202
"begin": "\\(",
2203
"beginCaptures": {
2204
"0": {
2205
"name": "punctuation.definition.begin.bracket.round.go"
2206
}
2207
},
2208
"end": "\\)",
2209
"endCaptures": {
2210
"0": {
2211
"name": "punctuation.definition.end.bracket.round.go"
2212
}
2213
},
2214
"patterns": [
2215
{
2216
"include": "#function_param_types"
2217
}
2218
]
2219
},
2220
{
2221
"comment": "other types",
2222
"match": "([\\w\\.]+)",
2223
"captures": {
2224
"1": {
2225
"patterns": [
2226
{
2227
"include": "#type-declarations"
2228
},
2229
{
2230
"match": "\\w+",
2231
"name": "entity.name.type.go"
2232
}
2233
]
2234
}
2235
}
2236
}
2237
]
2238
},
2239
"single_type": {
2240
"patterns": [
2241
{
2242
"comment": "single type declaration",
2243
"match": "(?:(?:^\\s*)(\\btype\\b)(?:\\s*)([\\w\\.\\*]+)(?:\\s+)(?!(?:\\=\\s*)?(?:[\\[\\]\\*]+)?\\b(?:struct|interface)\\b)([\\s\\S]+))",
2244
"captures": {
2245
"1": {
2246
"name": "keyword.type.go"
2247
},
2248
"2": {
2249
"patterns": [
2250
{
2251
"include": "#type-declarations"
2252
},
2253
{
2254
"match": "\\w+",
2255
"name": "entity.name.type.go"
2256
}
2257
]
2258
},
2259
"3": {
2260
"patterns": [
2261
{
2262
"begin": "\\(",
2263
"beginCaptures": {
2264
"0": {
2265
"name": "punctuation.definition.begin.bracket.round.go"
2266
}
2267
},
2268
"end": "\\)",
2269
"endCaptures": {
2270
"0": {
2271
"name": "punctuation.definition.end.bracket.round.go"
2272
}
2273
},
2274
"patterns": [
2275
{
2276
"include": "#function_param_types"
2277
},
2278
{
2279
"include": "$self"
2280
}
2281
]
2282
},
2283
{
2284
"include": "#type-declarations"
2285
},
2286
{
2287
"include": "#generic_types"
2288
},
2289
{
2290
"match": "\\w+",
2291
"name": "entity.name.type.go"
2292
}
2293
]
2294
}
2295
}
2296
},
2297
{
2298
"comment": "single type declaration with generics",
2299
"begin": "(?:(?:^|\\s+)(\\btype\\b)(?:\\s*)([\\w\\.\\*]+)(?=\\[))",
2300
"beginCaptures": {
2301
"1": {
2302
"name": "keyword.type.go"
2303
},
2304
"2": {
2305
"patterns": [
2306
{
2307
"include": "#type-declarations-without-brackets"
2308
},
2309
{
2310
"match": "\\w+",
2311
"name": "entity.name.type.go"
2312
}
2313
]
2314
}
2315
},
2316
"end": "(?:(?<=\\])((?:\\s+)(?:\\=\\s*)?(?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:(?!(?:[\\[\\]\\*]+)?(?:\\bstruct\\b|\\binterface\\b|\\bfunc\\b))[\\w\\.\\-\\*\\[\\]]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*))?)",
2317
"endCaptures": {
2318
"1": {
2319
"patterns": [
2320
{
2321
"include": "#type-declarations-without-brackets"
2322
},
2323
{
2324
"match": "\\[",
2325
"name": "punctuation.definition.begin.bracket.square.go"
2326
},
2327
{
2328
"match": "\\]",
2329
"name": "punctuation.definition.end.bracket.square.go"
2330
},
2331
{
2332
"match": "\\w+",
2333
"name": "entity.name.type.go"
2334
}
2335
]
2336
}
2337
},
2338
"patterns": [
2339
{
2340
"include": "#struct_variables_types"
2341
},
2342
{
2343
"include": "#type-declarations-without-brackets"
2344
},
2345
{
2346
"include": "#parameter-variable-types"
2347
},
2348
{
2349
"match": "\\[",
2350
"name": "punctuation.definition.begin.bracket.square.go"
2351
},
2352
{
2353
"match": "\\]",
2354
"name": "punctuation.definition.end.bracket.square.go"
2355
},
2356
{
2357
"match": "\\{",
2358
"name": "punctuation.definition.begin.bracket.curly.go"
2359
},
2360
{
2361
"match": "\\}",
2362
"name": "punctuation.definition.end.bracket.curly.go"
2363
},
2364
{
2365
"match": "\\(",
2366
"name": "punctuation.definition.begin.bracket.round.go"
2367
},
2368
{
2369
"match": "\\)",
2370
"name": "punctuation.definition.end.bracket.round.go"
2371
},
2372
{
2373
"match": "\\w+",
2374
"name": "entity.name.type.go"
2375
}
2376
]
2377
}
2378
]
2379
},
2380
"multi_types": {
2381
"comment": "multi type declaration",
2382
"begin": "(\\btype\\b)\\s*(\\()",
2383
"beginCaptures": {
2384
"1": {
2385
"name": "keyword.type.go"
2386
},
2387
"2": {
2388
"name": "punctuation.definition.begin.bracket.round.go"
2389
}
2390
},
2391
"patterns": [
2392
{
2393
"include": "#struct_variables_types"
2394
},
2395
{
2396
"include": "#interface_variables_types"
2397
},
2398
{
2399
"include": "#type-declarations-without-brackets"
2400
},
2401
{
2402
"include": "#parameter-variable-types"
2403
},
2404
{
2405
"match": "\\w+",
2406
"name": "entity.name.type.go"
2407
}
2408
],
2409
"end": "\\)",
2410
"endCaptures": {
2411
"0": {
2412
"name": "punctuation.definition.end.bracket.round.go"
2413
}
2414
}
2415
},
2416
"after_control_variables": {
2417
"comment": "After control variables, to not highlight as a struct/interface (before formatting with gofmt)",
2418
"match": "(?:(?<=\\brange\\b|\\;|\\bif\\b|\\bfor\\b|\\<|\\>|\\<\\=|\\>\\=|\\=\\=|\\!\\=|\\w(?:\\+|/|\\-|\\*|\\%)|\\w(?:\\+|/|\\-|\\*|\\%)\\=|\\|\\||\\&\\&)(?:\\s*)((?![\\[\\]]+)[[:alnum:]\\-\\_\\!\\.\\[\\]\\<\\>\\=\\*/\\+\\%\\:]+)(?:\\s*)(?=\\{))",
2419
"captures": {
2420
"1": {
2421
"patterns": [
2422
{
2423
"include": "#type-declarations-without-brackets"
2424
},
2425
{
2426
"match": "\\[",
2427
"name": "punctuation.definition.begin.bracket.square.go"
2428
},
2429
{
2430
"match": "\\]",
2431
"name": "punctuation.definition.end.bracket.square.go"
2432
},
2433
{
2434
"match": "\\w+",
2435
"name": "variable.other.go"
2436
}
2437
]
2438
}
2439
}
2440
},
2441
"syntax_errors": {
2442
"patterns": [
2443
{
2444
"comment": "Syntax error using slices",
2445
"match": "\\[\\](\\s+)",
2446
"captures": {
2447
"1": {
2448
"name": "invalid.illegal.slice.go"
2449
}
2450
}
2451
},
2452
{
2453
"comment": "Syntax error numeric literals",
2454
"match": "\\b0[0-7]*[89]\\d*\\b",
2455
"name": "invalid.illegal.numeric.go"
2456
}
2457
]
2458
},
2459
"built_in_functions": {
2460
"comment": "Built-in functions",
2461
"patterns": [
2462
{
2463
"match": "\\b(append|cap|close|complex|copy|delete|imag|len|panic|print|println|real|recover|min|max|clear)\\b(?=\\()",
2464
"name": "entity.name.function.support.builtin.go"
2465
},
2466
{
2467
"comment": "new keyword",
2468
"begin": "(\\bnew\\b)(\\()",
2469
"beginCaptures": {
2470
"1": {
2471
"name": "entity.name.function.support.builtin.go"
2472
},
2473
"2": {
2474
"name": "punctuation.definition.begin.bracket.round.go"
2475
}
2476
},
2477
"end": "\\)",
2478
"endCaptures": {
2479
"0": {
2480
"name": "punctuation.definition.end.bracket.round.go"
2481
}
2482
},
2483
"patterns": [
2484
{
2485
"include": "#functions"
2486
},
2487
{
2488
"include": "#struct_variables_types"
2489
},
2490
{
2491
"include": "#type-declarations"
2492
},
2493
{
2494
"include": "#generic_types"
2495
},
2496
{
2497
"match": "\\w+",
2498
"name": "entity.name.type.go"
2499
},
2500
{
2501
"include": "$self"
2502
}
2503
]
2504
},
2505
{
2506
"comment": "make keyword",
2507
"begin": "(?:(\\bmake\\b)(?:(\\()((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?:[\\[\\]\\*]+)?(?:(?!\\bmap\\b)(?:[\\w\\.]+))?(\\[(?:(?:[\\S]+)(?:(?:\\,\\s*(?:[\\S]+))*))?\\])?(?:\\,)?)?))",
2508
"beginCaptures": {
2509
"1": {
2510
"name": "entity.name.function.support.builtin.go"
2511
},
2512
"2": {
2513
"name": "punctuation.definition.begin.bracket.round.go"
2514
},
2515
"3": {
2516
"patterns": [
2517
{
2518
"include": "#type-declarations-without-brackets"
2519
},
2520
{
2521
"include": "#parameter-variable-types"
2522
},
2523
{
2524
"match": "\\w+",
2525
"name": "entity.name.type.go"
2526
}
2527
]
2528
}
2529
},
2530
"end": "\\)",
2531
"endCaptures": {
2532
"0": {
2533
"name": "punctuation.definition.end.bracket.round.go"
2534
}
2535
},
2536
"patterns": [
2537
{
2538
"include": "$self"
2539
}
2540
]
2541
}
2542
]
2543
},
2544
"struct_interface_declaration": {
2545
"comment": "struct, interface type declarations (related to: struct_variables_types, interface_variables_types)",
2546
"match": "(?:(?:^\\s*)(\\btype\\b)(?:\\s*)([\\w\\.]+))",
2547
"captures": {
2548
"1": {
2549
"name": "keyword.type.go"
2550
},
2551
"2": {
2552
"patterns": [
2553
{
2554
"include": "#type-declarations"
2555
},
2556
{
2557
"match": "\\w+",
2558
"name": "entity.name.type.go"
2559
}
2560
]
2561
}
2562
}
2563
},
2564
"switch_types": {
2565
"comment": "switch type assertions, only highlights types after case keyword",
2566
"begin": "(?<=\\bswitch\\b)(?:\\s*)(?:(\\w+\\s*\\:\\=)?\\s*([\\w\\.\\*\\(\\)\\[\\]\\+/\\-\\%\\<\\>\\|\\&]+))(\\.\\(\\btype\\b\\)\\s*)(\\{)",
2567
"beginCaptures": {
2568
"1": {
2569
"patterns": [
2570
{
2571
"include": "#operators"
2572
},
2573
{
2574
"match": "\\w+",
2575
"name": "variable.other.assignment.go"
2576
}
2577
]
2578
},
2579
"2": {
2580
"patterns": [
2581
{
2582
"include": "#support_functions"
2583
},
2584
{
2585
"include": "#type-declarations"
2586
},
2587
{
2588
"match": "\\w+",
2589
"name": "variable.other.go"
2590
}
2591
]
2592
},
2593
"3": {
2594
"patterns": [
2595
{
2596
"include": "#delimiters"
2597
},
2598
{
2599
"include": "#brackets"
2600
},
2601
{
2602
"match": "\\btype\\b",
2603
"name": "keyword.type.go"
2604
}
2605
]
2606
},
2607
"4": {
2608
"name": "punctuation.definition.begin.bracket.curly.go"
2609
}
2610
},
2611
"end": "\\}",
2612
"endCaptures": {
2613
"0": {
2614
"name": "punctuation.definition.end.bracket.curly.go"
2615
}
2616
},
2617
"patterns": [
2618
{
2619
"comment": "types after case keyword with single line",
2620
"match": "(?:^\\s*(\\bcase\\b))(?:\\s+)([\\w\\.\\,\\*\\=\\<\\>\\!\\s]+)(:)(\\s*/(?:/|\\*)\\s*.*)?$",
2621
"captures": {
2622
"1": {
2623
"name": "keyword.control.go"
2624
},
2625
"2": {
2626
"patterns": [
2627
{
2628
"include": "#type-declarations"
2629
},
2630
{
2631
"match": "\\w+",
2632
"name": "entity.name.type.go"
2633
}
2634
]
2635
},
2636
"3": {
2637
"name": "punctuation.other.colon.go"
2638
},
2639
"4": {
2640
"patterns": [
2641
{
2642
"include": "#comments"
2643
}
2644
]
2645
}
2646
}
2647
},
2648
{
2649
"comment": "types after case keyword with multi lines",
2650
"begin": "\\bcase\\b",
2651
"beginCaptures": {
2652
"0": {
2653
"name": "keyword.control.go"
2654
}
2655
},
2656
"end": "\\:",
2657
"endCaptures": {
2658
"0": {
2659
"name": "punctuation.other.colon.go"
2660
}
2661
},
2662
"patterns": [
2663
{
2664
"include": "#type-declarations"
2665
},
2666
{
2667
"match": "\\w+",
2668
"name": "entity.name.type.go"
2669
}
2670
]
2671
},
2672
{
2673
"include": "$self"
2674
}
2675
]
2676
},
2677
"switch_variables": {
2678
"comment": "variables after case control keyword in switch/select expression, to not scope them as property variables",
2679
"patterns": [
2680
{
2681
"comment": "single line",
2682
"match": "(?:(?:^\\s*(\\bcase\\b))(?:\\s+)([\\s\\S]+(?:\\:)\\s*(?:/(?:/|\\*).*)?)$)",
2683
"captures": {
2684
"1": {
2685
"name": "keyword.control.go"
2686
},
2687
"2": {
2688
"patterns": [
2689
{
2690
"include": "#type-declarations"
2691
},
2692
{
2693
"include": "#support_functions"
2694
},
2695
{
2696
"include": "#variable_assignment"
2697
},
2698
{
2699
"match": "\\w+",
2700
"name": "variable.other.go"
2701
}
2702
]
2703
}
2704
}
2705
},
2706
{
2707
"comment": "multi lines",
2708
"begin": "(?<=\\bswitch\\b)(?:\\s*)((?:[\\w\\.]+(?:\\s*(?:[\\:\\=\\!\\,\\+/\\-\\%\\<\\>\\|\\&]+)\\s*[\\w\\.]+)*\\s*(?:[\\:\\=\\!\\,\\+/\\-\\%\\<\\>\\|\\&]+))?(?:\\s*(?:[\\w\\.\\*\\(\\)\\[\\]\\+/\\-\\%\\<\\>\\|\\&]+)?\\s*(?:\\;\\s*(?:[\\w\\.\\*\\(\\)\\[\\]\\+/\\-\\%\\<\\>\\|\\&]+)\\s*)?))(\\{)",
2709
"beginCaptures": {
2710
"1": {
2711
"patterns": [
2712
{
2713
"include": "#support_functions"
2714
},
2715
{
2716
"include": "#type-declarations"
2717
},
2718
{
2719
"include": "#variable_assignment"
2720
},
2721
{
2722
"match": "\\w+",
2723
"name": "variable.other.go"
2724
}
2725
]
2726
},
2727
"2": {
2728
"name": "punctuation.definition.begin.bracket.curly.go"
2729
}
2730
},
2731
"end": "\\}",
2732
"endCaptures": {
2733
"0": {
2734
"name": "punctuation.definition.end.bracket.curly.go"
2735
}
2736
},
2737
"patterns": [
2738
{
2739
"begin": "\\bcase\\b",
2740
"beginCaptures": {
2741
"0": {
2742
"name": "keyword.control.go"
2743
}
2744
},
2745
"end": "\\:",
2746
"endCaptures": {
2747
"0": {
2748
"name": "punctuation.other.colon.go"
2749
}
2750
},
2751
"patterns": [
2752
{
2753
"include": "#support_functions"
2754
},
2755
{
2756
"include": "#type-declarations"
2757
},
2758
{
2759
"include": "#variable_assignment"
2760
},
2761
{
2762
"match": "\\w+",
2763
"name": "variable.other.go"
2764
}
2765
]
2766
},
2767
{
2768
"include": "$self"
2769
}
2770
]
2771
}
2772
]
2773
},
2774
"var_assignment": {
2775
"comment": "variable assignment with var keyword",
2776
"patterns": [
2777
{
2778
"comment": "single assignment",
2779
"match": "(?:(?<=\\bvar\\b)(?:\\s*)(\\b[\\w\\.]+(?:\\,\\s*[\\w\\.]+)*)(?:\\s*)((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?!(?:[\\[\\]\\*]+)?\\b(?:struct|func|map)\\b)(?:[\\w\\.\\[\\]\\*]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*)?(?:\\s*)(?:\\=)?)?)",
2780
"captures": {
2781
"1": {
2782
"patterns": [
2783
{
2784
"include": "#delimiters"
2785
},
2786
{
2787
"match": "\\w+",
2788
"name": "variable.other.assignment.go"
2789
}
2790
]
2791
},
2792
"2": {
2793
"patterns": [
2794
{
2795
"include": "#type-declarations-without-brackets"
2796
},
2797
{
2798
"include": "#generic_types"
2799
},
2800
{
2801
"match": "\\(",
2802
"name": "punctuation.definition.begin.bracket.round.go"
2803
},
2804
{
2805
"match": "\\)",
2806
"name": "punctuation.definition.end.bracket.round.go"
2807
},
2808
{
2809
"match": "\\[",
2810
"name": "punctuation.definition.begin.bracket.square.go"
2811
},
2812
{
2813
"match": "\\]",
2814
"name": "punctuation.definition.end.bracket.square.go"
2815
},
2816
{
2817
"match": "\\w+",
2818
"name": "entity.name.type.go"
2819
}
2820
]
2821
}
2822
}
2823
},
2824
{
2825
"comment": "multi assignment",
2826
"begin": "(?:(?<=\\bvar\\b)(?:\\s*)(\\())",
2827
"beginCaptures": {
2828
"1": {
2829
"name": "punctuation.definition.begin.bracket.round.go"
2830
}
2831
},
2832
"end": "\\)",
2833
"endCaptures": {
2834
"0": {
2835
"name": "punctuation.definition.end.bracket.round.go"
2836
}
2837
},
2838
"patterns": [
2839
{
2840
"match": "(?:(?:^\\s*)(\\b[\\w\\.]+(?:\\,\\s*[\\w\\.]+)*)(?:\\s*)((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?!(?:[\\[\\]\\*]+)?\\b(?:struct|func|map)\\b)(?:[\\w\\.\\[\\]\\*]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*)?(?:\\s*)(?:\\=)?)?)",
2841
"captures": {
2842
"1": {
2843
"patterns": [
2844
{
2845
"include": "#delimiters"
2846
},
2847
{
2848
"match": "\\w+",
2849
"name": "variable.other.assignment.go"
2850
}
2851
]
2852
},
2853
"2": {
2854
"patterns": [
2855
{
2856
"include": "#type-declarations-without-brackets"
2857
},
2858
{
2859
"include": "#generic_types"
2860
},
2861
{
2862
"match": "\\(",
2863
"name": "punctuation.definition.begin.bracket.round.go"
2864
},
2865
{
2866
"match": "\\)",
2867
"name": "punctuation.definition.end.bracket.round.go"
2868
},
2869
{
2870
"match": "\\[",
2871
"name": "punctuation.definition.begin.bracket.square.go"
2872
},
2873
{
2874
"match": "\\]",
2875
"name": "punctuation.definition.end.bracket.square.go"
2876
},
2877
{
2878
"match": "\\w+",
2879
"name": "entity.name.type.go"
2880
}
2881
]
2882
}
2883
}
2884
},
2885
{
2886
"include": "$self"
2887
}
2888
]
2889
}
2890
]
2891
},
2892
"const_assignment": {
2893
"comment": "constant assignment with const keyword",
2894
"patterns": [
2895
{
2896
"comment": "single assignment",
2897
"match": "(?:(?<=\\bconst\\b)(?:\\s*)(\\b[\\w\\.]+(?:\\,\\s*[\\w\\.]+)*)(?:\\s*)((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?!(?:[\\[\\]\\*]+)?\\b(?:struct|func|map)\\b)(?:[\\w\\.\\[\\]\\*]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*)?(?:\\s*)(?:\\=)?)?)",
2898
"captures": {
2899
"1": {
2900
"patterns": [
2901
{
2902
"include": "#delimiters"
2903
},
2904
{
2905
"match": "\\w+",
2906
"name": "variable.other.constant.go"
2907
}
2908
]
2909
},
2910
"2": {
2911
"patterns": [
2912
{
2913
"include": "#type-declarations-without-brackets"
2914
},
2915
{
2916
"include": "#generic_types"
2917
},
2918
{
2919
"match": "\\(",
2920
"name": "punctuation.definition.begin.bracket.round.go"
2921
},
2922
{
2923
"match": "\\)",
2924
"name": "punctuation.definition.end.bracket.round.go"
2925
},
2926
{
2927
"match": "\\[",
2928
"name": "punctuation.definition.begin.bracket.square.go"
2929
},
2930
{
2931
"match": "\\]",
2932
"name": "punctuation.definition.end.bracket.square.go"
2933
},
2934
{
2935
"match": "\\w+",
2936
"name": "entity.name.type.go"
2937
}
2938
]
2939
}
2940
}
2941
},
2942
{
2943
"comment": "multi assignment",
2944
"begin": "(?:(?<=\\bconst\\b)(?:\\s*)(\\())",
2945
"beginCaptures": {
2946
"1": {
2947
"name": "punctuation.definition.begin.bracket.round.go"
2948
}
2949
},
2950
"end": "\\)",
2951
"endCaptures": {
2952
"0": {
2953
"name": "punctuation.definition.end.bracket.round.go"
2954
}
2955
},
2956
"patterns": [
2957
{
2958
"match": "(?:(?:^\\s*)(\\b[\\w\\.]+(?:\\,\\s*[\\w\\.]+)*)(?:\\s*)((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?!(?:[\\[\\]\\*]+)?\\b(?:struct|func|map)\\b)(?:[\\w\\.\\[\\]\\*]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*)?(?:\\s*)(?:\\=)?)?)",
2959
"captures": {
2960
"1": {
2961
"patterns": [
2962
{
2963
"include": "#delimiters"
2964
},
2965
{
2966
"match": "\\w+",
2967
"name": "variable.other.constant.go"
2968
}
2969
]
2970
},
2971
"2": {
2972
"patterns": [
2973
{
2974
"include": "#type-declarations-without-brackets"
2975
},
2976
{
2977
"include": "#generic_types"
2978
},
2979
{
2980
"match": "\\(",
2981
"name": "punctuation.definition.begin.bracket.round.go"
2982
},
2983
{
2984
"match": "\\)",
2985
"name": "punctuation.definition.end.bracket.round.go"
2986
},
2987
{
2988
"match": "\\[",
2989
"name": "punctuation.definition.begin.bracket.square.go"
2990
},
2991
{
2992
"match": "\\]",
2993
"name": "punctuation.definition.end.bracket.square.go"
2994
},
2995
{
2996
"match": "\\w+",
2997
"name": "entity.name.type.go"
2998
}
2999
]
3000
}
3001
}
3002
},
3003
{
3004
"include": "$self"
3005
}
3006
]
3007
}
3008
]
3009
},
3010
"variable_assignment": {
3011
"comment": "variable assignment",
3012
"patterns": [
3013
{
3014
"comment": "variable assignment with :=",
3015
"match": "\\b\\w+(?:\\,\\s*\\w+)*(?=\\s*:=)",
3016
"captures": {
3017
"0": {
3018
"patterns": [
3019
{
3020
"include": "#delimiters"
3021
},
3022
{
3023
"match": "\\d\\w*",
3024
"name": "invalid.illegal.identifier.go"
3025
},
3026
{
3027
"match": "\\w+",
3028
"name": "variable.other.assignment.go"
3029
}
3030
]
3031
}
3032
}
3033
},
3034
{
3035
"comment": "variable assignment with =",
3036
"match": "\\b[\\w\\.\\*]+(?:\\,\\s*[\\w\\.\\*]+)*(?=\\s*=(?!=))",
3037
"captures": {
3038
"0": {
3039
"patterns": [
3040
{
3041
"include": "#delimiters"
3042
},
3043
{
3044
"include": "#operators"
3045
},
3046
{
3047
"match": "\\d\\w*",
3048
"name": "invalid.illegal.identifier.go"
3049
},
3050
{
3051
"match": "\\w+",
3052
"name": "variable.other.assignment.go"
3053
}
3054
]
3055
}
3056
}
3057
}
3058
]
3059
},
3060
"generic_types": {
3061
"comment": "Generic support for all types",
3062
"match": "(?:([\\w\\.\\*]+)(\\[(?:[^\\]]+)?\\]))",
3063
"captures": {
3064
"1": {
3065
"patterns": [
3066
{
3067
"include": "#type-declarations"
3068
},
3069
{
3070
"match": "\\w+",
3071
"name": "entity.name.type.go"
3072
}
3073
]
3074
},
3075
"2": {
3076
"patterns": [
3077
{
3078
"include": "#parameter-variable-types"
3079
}
3080
]
3081
}
3082
}
3083
},
3084
"slice_index_variables": {
3085
"comment": "slice index and capacity variables, to not scope them as property variables",
3086
"match": "(?<=\\w\\[)((?:(?:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+\\:)|(?:\\:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+))(?:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+)?(?:\\:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+)?)(?=\\])",
3087
"captures": {
3088
"1": {
3089
"patterns": [
3090
{
3091
"include": "#type-declarations"
3092
},
3093
{
3094
"match": "\\w+",
3095
"name": "variable.other.go"
3096
}
3097
]
3098
}
3099
}
3100
},
3101
"property_variables": {
3102
"comment": "Property variables in struct",
3103
"match": "((?:\\b[\\w\\.]+)(?:\\:(?!\\=)))",
3104
"captures": {
3105
"1": {
3106
"patterns": [
3107
{
3108
"include": "#type-declarations"
3109
},
3110
{
3111
"match": "\\w+",
3112
"name": "variable.other.property.go"
3113
}
3114
]
3115
}
3116
}
3117
},
3118
"label_loop_variables": {
3119
"comment": "labeled loop variable name",
3120
"match": "((?:^\\s*\\w+:\\s*$)|(?:^\\s*(?:\\bbreak\\b|\\bgoto\\b|\\bcontinue\\b)\\s+\\w+(?:\\s*/(?:/|\\*)\\s*.*)?$))",
3121
"captures": {
3122
"1": {
3123
"patterns": [
3124
{
3125
"include": "#type-declarations"
3126
},
3127
{
3128
"match": "\\w+",
3129
"name": "variable.other.label.go"
3130
}
3131
]
3132
}
3133
}
3134
},
3135
"double_parentheses_types": {
3136
"comment": "double parentheses types",
3137
"match": "(?:(?<!\\w)(\\((?:[\\[\\]\\*]+)?(?:[\\w\\.]+)(?:\\[(?:(?:[\\w\\.\\*\\[\\]\\{\\}]+)(?:(?:\\,\\s*(?:[\\w\\.\\*\\[\\]\\{\\}]+))*))?\\])?\\))(?=\\())",
3138
"captures": {
3139
"1": {
3140
"patterns": [
3141
{
3142
"include": "#type-declarations-without-brackets"
3143
},
3144
{
3145
"match": "\\(",
3146
"name": "punctuation.definition.begin.bracket.round.go"
3147
},
3148
{
3149
"match": "\\)",
3150
"name": "punctuation.definition.end.bracket.round.go"
3151
},
3152
{
3153
"match": "\\[",
3154
"name": "punctuation.definition.begin.bracket.square.go"
3155
},
3156
{
3157
"match": "\\]",
3158
"name": "punctuation.definition.end.bracket.square.go"
3159
},
3160
{
3161
"match": "\\{",
3162
"name": "punctuation.definition.begin.bracket.curly.go"
3163
},
3164
{
3165
"match": "\\}",
3166
"name": "punctuation.definition.end.bracket.curly.go"
3167
},
3168
{
3169
"match": "\\w+",
3170
"name": "entity.name.type.go"
3171
}
3172
]
3173
}
3174
}
3175
},
3176
"hover": {
3177
"comment": "hovering with the mouse",
3178
"patterns": [
3179
{
3180
"comment": "struct field property and types when hovering with the mouse",
3181
"match": "(?:(?<=^\\bfield\\b)\\s+([\\w\\*\\.]+)\\s+([\\s\\S]+))",
3182
"captures": {
3183
"1": {
3184
"patterns": [
3185
{
3186
"include": "#type-declarations"
3187
},
3188
{
3189
"match": "\\w+",
3190
"name": "variable.other.property.go"
3191
}
3192
]
3193
},
3194
"2": {
3195
"patterns": [
3196
{
3197
"match": "\\binvalid\\b\\s+\\btype\\b",
3198
"name": "invalid.field.go"
3199
},
3200
{
3201
"include": "#type-declarations-without-brackets"
3202
},
3203
{
3204
"include": "#parameter-variable-types"
3205
},
3206
{
3207
"match": "\\w+",
3208
"name": "entity.name.type.go"
3209
}
3210
]
3211
}
3212
}
3213
},
3214
{
3215
"comment": "return types when hovering with the mouse",
3216
"match": "(?:(?<=^\\breturns\\b)\\s+([\\s\\S]+))",
3217
"captures": {
3218
"1": {
3219
"patterns": [
3220
{
3221
"include": "#type-declarations-without-brackets"
3222
},
3223
{
3224
"include": "#parameter-variable-types"
3225
},
3226
{
3227
"match": "\\w+",
3228
"name": "entity.name.type.go"
3229
}
3230
]
3231
}
3232
}
3233
}
3234
]
3235
},
3236
"other_variables": {
3237
"comment": "all other variables",
3238
"match": "\\w+",
3239
"name": "variable.other.go"
3240
}
3241
}
3242
}
3243