@codingame/monaco-vscode-go-default-extension 1.81.8-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1017 @@
1
+ {
2
+ "information_for_contributors": [
3
+ "This file has been converted from https://github.com/jeff-hykin/better-go-syntax/blob/master/export/generated.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/jeff-hykin/better-go-syntax/commit/6175663a7a0e23d58ccf9aab95054cb6e5c92aff",
8
+ "name": "Go",
9
+ "scopeName": "source.go",
10
+ "patterns": [
11
+ {
12
+ "include": "#comments"
13
+ },
14
+ {
15
+ "include": "#comments"
16
+ },
17
+ {
18
+ "comment": "Interpreted string literals",
19
+ "begin": "\"",
20
+ "beginCaptures": {
21
+ "0": {
22
+ "name": "punctuation.definition.string.begin.go"
23
+ }
24
+ },
25
+ "end": "\"",
26
+ "endCaptures": {
27
+ "0": {
28
+ "name": "punctuation.definition.string.end.go"
29
+ }
30
+ },
31
+ "name": "string.quoted.double.go",
32
+ "patterns": [
33
+ {
34
+ "include": "#string_escaped_char"
35
+ },
36
+ {
37
+ "include": "#string_placeholder"
38
+ }
39
+ ]
40
+ },
41
+ {
42
+ "comment": "Raw string literals",
43
+ "begin": "`",
44
+ "beginCaptures": {
45
+ "0": {
46
+ "name": "punctuation.definition.string.begin.go"
47
+ }
48
+ },
49
+ "end": "`",
50
+ "endCaptures": {
51
+ "0": {
52
+ "name": "punctuation.definition.string.end.go"
53
+ }
54
+ },
55
+ "name": "string.quoted.raw.go",
56
+ "patterns": [
57
+ {
58
+ "include": "#string_placeholder"
59
+ }
60
+ ]
61
+ },
62
+ {
63
+ "comment": "Syntax error receiving channels",
64
+ "match": "<\\-([\\t ]+)chan\\b",
65
+ "captures": {
66
+ "1": {
67
+ "name": "invalid.illegal.receive-channel.go"
68
+ }
69
+ }
70
+ },
71
+ {
72
+ "comment": "Syntax error sending channels",
73
+ "match": "\\bchan([\\t ]+)<-",
74
+ "captures": {
75
+ "1": {
76
+ "name": "invalid.illegal.send-channel.go"
77
+ }
78
+ }
79
+ },
80
+ {
81
+ "comment": "Syntax error using slices",
82
+ "match": "\\[\\](\\s+)",
83
+ "captures": {
84
+ "1": {
85
+ "name": "invalid.illegal.slice.go"
86
+ }
87
+ }
88
+ },
89
+ {
90
+ "comment": "Syntax error numeric literals",
91
+ "match": "\\b0[0-7]*[89]\\d*\\b",
92
+ "name": "invalid.illegal.numeric.go"
93
+ },
94
+ {
95
+ "comment": "Built-in functions",
96
+ "match": "\\b(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)\\b(?=\\()",
97
+ "name": "support.function.builtin.go"
98
+ },
99
+ {
100
+ "comment": "Function declarations",
101
+ "match": "^(\\bfunc\\b)(?:\\s+(\\([^\\)]+\\)\\s+)?(\\w+)(?=\\())?",
102
+ "captures": {
103
+ "1": {
104
+ "name": "keyword.function.go"
105
+ },
106
+ "2": {
107
+ "patterns": [
108
+ {
109
+ "include": "#brackets"
110
+ },
111
+ {
112
+ "include": "#operators"
113
+ }
114
+ ]
115
+ },
116
+ "3": {
117
+ "patterns": [
118
+ {
119
+ "match": "\\d\\w*",
120
+ "name": "invalid.illegal.identifier.go"
121
+ },
122
+ {
123
+ "match": "\\w+",
124
+ "name": "entity.name.function.go"
125
+ }
126
+ ]
127
+ }
128
+ }
129
+ },
130
+ {
131
+ "comment": "Functions",
132
+ "match": "(\\bfunc\\b)|(\\w+)(?=\\()",
133
+ "captures": {
134
+ "1": {
135
+ "name": "keyword.function.go"
136
+ },
137
+ "2": {
138
+ "patterns": [
139
+ {
140
+ "match": "\\d\\w*",
141
+ "name": "invalid.illegal.identifier.go"
142
+ },
143
+ {
144
+ "match": "\\w+",
145
+ "name": "support.function.go"
146
+ }
147
+ ]
148
+ }
149
+ }
150
+ },
151
+ {
152
+ "include": "#numeric_literals"
153
+ },
154
+ {
155
+ "comment": "Language constants",
156
+ "match": "\\b(true|false|nil|iota)\\b",
157
+ "name": "constant.language.go"
158
+ },
159
+ {
160
+ "begin": "\\b(package)\\s+",
161
+ "beginCaptures": {
162
+ "1": {
163
+ "name": "keyword.package.go"
164
+ }
165
+ },
166
+ "end": "(?!\\G)",
167
+ "patterns": [
168
+ {
169
+ "match": "\\d\\w*",
170
+ "name": "invalid.illegal.identifier.go"
171
+ },
172
+ {
173
+ "match": "\\w+",
174
+ "name": "entity.name.package.go"
175
+ }
176
+ ]
177
+ },
178
+ {
179
+ "begin": "\\b(type)\\s+",
180
+ "beginCaptures": {
181
+ "1": {
182
+ "name": "keyword.type.go"
183
+ }
184
+ },
185
+ "end": "(?!\\G)",
186
+ "patterns": [
187
+ {
188
+ "match": "\\d\\w*",
189
+ "name": "invalid.illegal.identifier.go"
190
+ },
191
+ {
192
+ "match": "\\w+",
193
+ "name": "entity.name.type.go"
194
+ }
195
+ ]
196
+ },
197
+ {
198
+ "begin": "\\b(import)\\s+",
199
+ "beginCaptures": {
200
+ "1": {
201
+ "name": "keyword.import.go"
202
+ }
203
+ },
204
+ "end": "(?!\\G)",
205
+ "patterns": [
206
+ {
207
+ "include": "#imports"
208
+ }
209
+ ]
210
+ },
211
+ {
212
+ "begin": "\\b(var)\\s+",
213
+ "beginCaptures": {
214
+ "1": {
215
+ "name": "keyword.var.go"
216
+ }
217
+ },
218
+ "end": "(?!\\G)",
219
+ "patterns": [
220
+ {
221
+ "include": "#variables"
222
+ }
223
+ ]
224
+ },
225
+ {
226
+ "match": "(?<!var)\\s*(\\w+(?:\\.\\w+)*(?>,\\s*\\w+(?:\\.\\w+)*)*)(?=\\s*=(?!=))",
227
+ "captures": {
228
+ "1": {
229
+ "patterns": [
230
+ {
231
+ "match": "\\d\\w*",
232
+ "name": "invalid.illegal.identifier.go"
233
+ },
234
+ {
235
+ "match": "\\w+(?:\\.\\w+)*",
236
+ "name": "variable.other.assignment.go",
237
+ "captures": {
238
+ "0": {
239
+ "patterns": [
240
+ {
241
+ "include": "#delimiters"
242
+ }
243
+ ]
244
+ }
245
+ }
246
+ },
247
+ {
248
+ "include": "#delimiters"
249
+ }
250
+ ]
251
+ }
252
+ }
253
+ },
254
+ {
255
+ "match": "\\b\\w+(?:,\\s*\\w+)*(?=\\s*:=)",
256
+ "captures": {
257
+ "0": {
258
+ "patterns": [
259
+ {
260
+ "match": "\\d\\w*",
261
+ "name": "invalid.illegal.identifier.go"
262
+ },
263
+ {
264
+ "match": "\\w+",
265
+ "name": "variable.other.assignment.go"
266
+ },
267
+ {
268
+ "include": "#delimiters"
269
+ }
270
+ ]
271
+ }
272
+ }
273
+ },
274
+ {
275
+ "comment": "Terminators",
276
+ "match": ";",
277
+ "name": "punctuation.terminator.go"
278
+ },
279
+ {
280
+ "include": "#brackets"
281
+ },
282
+ {
283
+ "include": "#delimiters"
284
+ },
285
+ {
286
+ "include": "#keywords"
287
+ },
288
+ {
289
+ "include": "#operators"
290
+ },
291
+ {
292
+ "include": "#runes"
293
+ },
294
+ {
295
+ "include": "#storage_types"
296
+ }
297
+ ],
298
+ "repository": {
299
+ "brackets": {
300
+ "patterns": [
301
+ {
302
+ "begin": "{",
303
+ "beginCaptures": {
304
+ "0": {
305
+ "name": "punctuation.definition.begin.bracket.curly.go"
306
+ }
307
+ },
308
+ "end": "}",
309
+ "endCaptures": {
310
+ "0": {
311
+ "name": "punctuation.definition.end.bracket.curly.go"
312
+ }
313
+ },
314
+ "patterns": [
315
+ {
316
+ "include": "$self"
317
+ }
318
+ ]
319
+ },
320
+ {
321
+ "begin": "\\(",
322
+ "beginCaptures": {
323
+ "0": {
324
+ "name": "punctuation.definition.begin.bracket.round.go"
325
+ }
326
+ },
327
+ "end": "\\)",
328
+ "endCaptures": {
329
+ "0": {
330
+ "name": "punctuation.definition.end.bracket.round.go"
331
+ }
332
+ },
333
+ "patterns": [
334
+ {
335
+ "include": "$self"
336
+ }
337
+ ]
338
+ },
339
+ {
340
+ "match": "\\[|\\]",
341
+ "name": "punctuation.definition.bracket.square.go"
342
+ }
343
+ ]
344
+ },
345
+ "comments": {
346
+ "patterns": [
347
+ {
348
+ "name": "comment.block.go",
349
+ "begin": "(\\/\\*)",
350
+ "beginCaptures": {
351
+ "1": {
352
+ "name": "punctuation.definition.comment.go"
353
+ }
354
+ },
355
+ "end": "(\\*\\/)",
356
+ "endCaptures": {
357
+ "1": {
358
+ "name": "punctuation.definition.comment.go"
359
+ }
360
+ }
361
+ },
362
+ {
363
+ "name": "comment.line.double-slash.go",
364
+ "begin": "(\\/\\/)",
365
+ "beginCaptures": {
366
+ "1": {
367
+ "name": "punctuation.definition.comment.go"
368
+ }
369
+ },
370
+ "end": "(?:\\n|$)"
371
+ }
372
+ ]
373
+ },
374
+ "delimiters": {
375
+ "patterns": [
376
+ {
377
+ "match": ",",
378
+ "name": "punctuation.other.comma.go"
379
+ },
380
+ {
381
+ "match": "\\.(?!\\.\\.)",
382
+ "name": "punctuation.other.period.go"
383
+ },
384
+ {
385
+ "match": ":(?!=)",
386
+ "name": "punctuation.other.colon.go"
387
+ }
388
+ ]
389
+ },
390
+ "imports": {
391
+ "patterns": [
392
+ {
393
+ "match": "((?!\\s+\")[^\\s]*)?\\s*((\")([^\"]*)(\"))",
394
+ "captures": {
395
+ "1": {
396
+ "name": "entity.alias.import.go"
397
+ },
398
+ "2": {
399
+ "name": "string.quoted.double.go"
400
+ },
401
+ "3": {
402
+ "name": "punctuation.definition.string.begin.go"
403
+ },
404
+ "4": {
405
+ "name": "entity.name.import.go"
406
+ },
407
+ "5": {
408
+ "name": "punctuation.definition.string.end.go"
409
+ }
410
+ }
411
+ },
412
+ {
413
+ "begin": "\\(",
414
+ "beginCaptures": {
415
+ "0": {
416
+ "name": "punctuation.definition.imports.begin.bracket.round.go"
417
+ }
418
+ },
419
+ "end": "\\)",
420
+ "endCaptures": {
421
+ "0": {
422
+ "name": "punctuation.definition.imports.end.bracket.round.go"
423
+ }
424
+ },
425
+ "patterns": [
426
+ {
427
+ "include": "#comments"
428
+ },
429
+ {
430
+ "include": "#imports"
431
+ }
432
+ ]
433
+ }
434
+ ]
435
+ },
436
+ "keywords": {
437
+ "patterns": [
438
+ {
439
+ "comment": "Flow control keywords",
440
+ "match": "\\b(break|case|continue|default|defer|else|fallthrough|for|go|goto|if|range|return|select|switch)\\b",
441
+ "name": "keyword.control.go"
442
+ },
443
+ {
444
+ "match": "\\bchan\\b",
445
+ "name": "keyword.channel.go"
446
+ },
447
+ {
448
+ "match": "\\bconst\\b",
449
+ "name": "keyword.const.go"
450
+ },
451
+ {
452
+ "match": "\\bfunc\\b",
453
+ "name": "keyword.function.go"
454
+ },
455
+ {
456
+ "match": "\\binterface\\b",
457
+ "name": "keyword.interface.go"
458
+ },
459
+ {
460
+ "match": "\\bmap\\b",
461
+ "name": "keyword.map.go"
462
+ },
463
+ {
464
+ "match": "\\bstruct\\b",
465
+ "name": "keyword.struct.go"
466
+ }
467
+ ]
468
+ },
469
+ "operators": {
470
+ "comment": "Note that the order here is very important!",
471
+ "patterns": [
472
+ {
473
+ "match": "(\\*|&)(?=\\w)",
474
+ "name": "keyword.operator.address.go"
475
+ },
476
+ {
477
+ "match": "<\\-",
478
+ "name": "keyword.operator.channel.go"
479
+ },
480
+ {
481
+ "match": "\\-\\-",
482
+ "name": "keyword.operator.decrement.go"
483
+ },
484
+ {
485
+ "match": "\\+\\+",
486
+ "name": "keyword.operator.increment.go"
487
+ },
488
+ {
489
+ "match": "(==|!=|<=|>=|<(?!<)|>(?!>))",
490
+ "name": "keyword.operator.comparison.go"
491
+ },
492
+ {
493
+ "match": "(&&|\\|\\||!)",
494
+ "name": "keyword.operator.logical.go"
495
+ },
496
+ {
497
+ "match": "(=|\\+=|\\-=|\\|=|\\^=|\\*=|/=|:=|%=|<<=|>>=|&\\^=|&=)",
498
+ "name": "keyword.operator.assignment.go"
499
+ },
500
+ {
501
+ "match": "(\\+|\\-|\\*|/|%)",
502
+ "name": "keyword.operator.arithmetic.go"
503
+ },
504
+ {
505
+ "match": "(&(?!\\^)|\\||\\^|&\\^|<<|>>)",
506
+ "name": "keyword.operator.arithmetic.bitwise.go"
507
+ },
508
+ {
509
+ "match": "\\.\\.\\.",
510
+ "name": "keyword.operator.ellipsis.go"
511
+ }
512
+ ]
513
+ },
514
+ "runes": {
515
+ "patterns": [
516
+ {
517
+ "begin": "'",
518
+ "beginCaptures": {
519
+ "0": {
520
+ "name": "punctuation.definition.string.begin.go"
521
+ }
522
+ },
523
+ "end": "'",
524
+ "endCaptures": {
525
+ "0": {
526
+ "name": "punctuation.definition.string.end.go"
527
+ }
528
+ },
529
+ "name": "string.quoted.rune.go",
530
+ "patterns": [
531
+ {
532
+ "match": "\\G(\\\\([0-7]{3}|[abfnrtv\\\\'\"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})|.)(?=')",
533
+ "name": "constant.other.rune.go"
534
+ },
535
+ {
536
+ "match": "[^']+",
537
+ "name": "invalid.illegal.unknown-rune.go"
538
+ }
539
+ ]
540
+ }
541
+ ]
542
+ },
543
+ "storage_types": {
544
+ "patterns": [
545
+ {
546
+ "match": "\\bbool\\b",
547
+ "name": "storage.type.boolean.go"
548
+ },
549
+ {
550
+ "match": "\\bbyte\\b",
551
+ "name": "storage.type.byte.go"
552
+ },
553
+ {
554
+ "match": "\\berror\\b",
555
+ "name": "storage.type.error.go"
556
+ },
557
+ {
558
+ "match": "\\b(complex(64|128)|float(32|64)|u?int(8|16|32|64)?)\\b",
559
+ "name": "storage.type.numeric.go"
560
+ },
561
+ {
562
+ "match": "\\brune\\b",
563
+ "name": "storage.type.rune.go"
564
+ },
565
+ {
566
+ "match": "\\bstring\\b",
567
+ "name": "storage.type.string.go"
568
+ },
569
+ {
570
+ "match": "\\buintptr\\b",
571
+ "name": "storage.type.uintptr.go"
572
+ }
573
+ ]
574
+ },
575
+ "string_escaped_char": {
576
+ "patterns": [
577
+ {
578
+ "match": "\\\\([0-7]{3}|[abfnrtv\\\\'\"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})",
579
+ "name": "constant.character.escape.go"
580
+ },
581
+ {
582
+ "match": "\\\\[^0-7xuUabfnrtv\\'\"]",
583
+ "name": "invalid.illegal.unknown-escape.go"
584
+ }
585
+ ]
586
+ },
587
+ "string_placeholder": {
588
+ "patterns": [
589
+ {
590
+ "match": "%(\\[\\d+\\])?([\\+#\\-0\\x20]{,2}((\\d+|\\*)?(\\.?(\\d+|\\*|(\\[\\d+\\])\\*?)?(\\[\\d+\\])?)?))?[vT%tbcdoqxXUbeEfFgGspw]",
591
+ "name": "constant.other.placeholder.go"
592
+ }
593
+ ]
594
+ },
595
+ "variables": {
596
+ "patterns": [
597
+ {
598
+ "match": "(\\w+(?:,\\s*\\w+)*)(\\s+\\*?\\w+(?:\\.\\w+)?\\s*)?(?=\\s*=)",
599
+ "captures": {
600
+ "1": {
601
+ "patterns": [
602
+ {
603
+ "match": "\\d\\w*",
604
+ "name": "invalid.illegal.identifier.go"
605
+ },
606
+ {
607
+ "match": "\\w+",
608
+ "name": "variable.other.assignment.go"
609
+ },
610
+ {
611
+ "include": "#delimiters"
612
+ }
613
+ ]
614
+ },
615
+ "2": {
616
+ "patterns": [
617
+ {
618
+ "include": "$self"
619
+ }
620
+ ]
621
+ }
622
+ }
623
+ },
624
+ {
625
+ "match": "(\\w+(?:,\\s*\\w+)*)(\\s+(\\[(\\d*|\\.\\.\\.)\\])*\\*?(<-)?\\w+(?:\\.\\w+)?\\s*[^=].*)",
626
+ "captures": {
627
+ "1": {
628
+ "patterns": [
629
+ {
630
+ "match": "\\d\\w*",
631
+ "name": "invalid.illegal.identifier.go"
632
+ },
633
+ {
634
+ "match": "\\w+",
635
+ "name": "variable.other.declaration.go"
636
+ },
637
+ {
638
+ "include": "#delimiters"
639
+ }
640
+ ]
641
+ },
642
+ "2": {
643
+ "patterns": [
644
+ {
645
+ "include": "$self"
646
+ }
647
+ ]
648
+ }
649
+ }
650
+ },
651
+ {
652
+ "begin": "\\(",
653
+ "beginCaptures": {
654
+ "0": {
655
+ "name": "punctuation.definition.variables.begin.bracket.round.go"
656
+ }
657
+ },
658
+ "end": "\\)",
659
+ "endCaptures": {
660
+ "0": {
661
+ "name": "punctuation.definition.variables.end.bracket.round.go"
662
+ }
663
+ },
664
+ "patterns": [
665
+ {
666
+ "include": "$self"
667
+ },
668
+ {
669
+ "include": "#variables"
670
+ }
671
+ ]
672
+ }
673
+ ]
674
+ },
675
+ "numeric_literals": {
676
+ "match": "(?<!\\w)\\.?\\d(?:(?:[0-9a-zA-Z_\\.])|(?<=[eEpP])[+-])*",
677
+ "captures": {
678
+ "0": {
679
+ "patterns": [
680
+ {
681
+ "begin": "(?=.)",
682
+ "end": "(?:\\n|$)",
683
+ "patterns": [
684
+ {
685
+ "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|$))",
686
+ "captures": {
687
+ "1": {
688
+ "name": "constant.numeric.decimal.go",
689
+ "patterns": [
690
+ {
691
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
692
+ "name": "punctuation.separator.constant.numeric.go"
693
+ }
694
+ ]
695
+ },
696
+ "2": {
697
+ "name": "punctuation.separator.constant.numeric.go"
698
+ },
699
+ "3": {
700
+ "name": "constant.numeric.decimal.point.go"
701
+ },
702
+ "4": {
703
+ "name": "constant.numeric.decimal.go",
704
+ "patterns": [
705
+ {
706
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
707
+ "name": "punctuation.separator.constant.numeric.go"
708
+ }
709
+ ]
710
+ },
711
+ "5": {
712
+ "name": "punctuation.separator.constant.numeric.go"
713
+ },
714
+ "6": {
715
+ "name": "keyword.other.unit.exponent.decimal.go"
716
+ },
717
+ "7": {
718
+ "name": "keyword.operator.plus.exponent.decimal.go"
719
+ },
720
+ "8": {
721
+ "name": "keyword.operator.minus.exponent.decimal.go"
722
+ },
723
+ "9": {
724
+ "name": "constant.numeric.exponent.decimal.go",
725
+ "patterns": [
726
+ {
727
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
728
+ "name": "punctuation.separator.constant.numeric.go"
729
+ }
730
+ ]
731
+ },
732
+ "10": {
733
+ "name": "keyword.other.unit.imaginary.go"
734
+ },
735
+ "11": {
736
+ "name": "constant.numeric.decimal.go",
737
+ "patterns": [
738
+ {
739
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
740
+ "name": "punctuation.separator.constant.numeric.go"
741
+ }
742
+ ]
743
+ },
744
+ "12": {
745
+ "name": "punctuation.separator.constant.numeric.go"
746
+ },
747
+ "13": {
748
+ "name": "keyword.other.unit.exponent.decimal.go"
749
+ },
750
+ "14": {
751
+ "name": "keyword.operator.plus.exponent.decimal.go"
752
+ },
753
+ "15": {
754
+ "name": "keyword.operator.minus.exponent.decimal.go"
755
+ },
756
+ "16": {
757
+ "name": "constant.numeric.exponent.decimal.go",
758
+ "patterns": [
759
+ {
760
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
761
+ "name": "punctuation.separator.constant.numeric.go"
762
+ }
763
+ ]
764
+ },
765
+ "17": {
766
+ "name": "keyword.other.unit.imaginary.go"
767
+ },
768
+ "18": {
769
+ "name": "constant.numeric.decimal.point.go"
770
+ },
771
+ "19": {
772
+ "name": "constant.numeric.decimal.go",
773
+ "patterns": [
774
+ {
775
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
776
+ "name": "punctuation.separator.constant.numeric.go"
777
+ }
778
+ ]
779
+ },
780
+ "20": {
781
+ "name": "punctuation.separator.constant.numeric.go"
782
+ },
783
+ "21": {
784
+ "name": "keyword.other.unit.exponent.decimal.go"
785
+ },
786
+ "22": {
787
+ "name": "keyword.operator.plus.exponent.decimal.go"
788
+ },
789
+ "23": {
790
+ "name": "keyword.operator.minus.exponent.decimal.go"
791
+ },
792
+ "24": {
793
+ "name": "constant.numeric.exponent.decimal.go",
794
+ "patterns": [
795
+ {
796
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
797
+ "name": "punctuation.separator.constant.numeric.go"
798
+ }
799
+ ]
800
+ },
801
+ "25": {
802
+ "name": "keyword.other.unit.imaginary.go"
803
+ },
804
+ "26": {
805
+ "name": "keyword.other.unit.hexadecimal.go"
806
+ },
807
+ "27": {
808
+ "name": "constant.numeric.hexadecimal.go",
809
+ "patterns": [
810
+ {
811
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
812
+ "name": "punctuation.separator.constant.numeric.go"
813
+ }
814
+ ]
815
+ },
816
+ "28": {
817
+ "name": "punctuation.separator.constant.numeric.go"
818
+ },
819
+ "29": {
820
+ "name": "constant.numeric.hexadecimal.go"
821
+ },
822
+ "30": {
823
+ "name": "constant.numeric.hexadecimal.go",
824
+ "patterns": [
825
+ {
826
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
827
+ "name": "punctuation.separator.constant.numeric.go"
828
+ }
829
+ ]
830
+ },
831
+ "31": {
832
+ "name": "punctuation.separator.constant.numeric.go"
833
+ },
834
+ "32": {
835
+ "name": "keyword.other.unit.exponent.hexadecimal.go"
836
+ },
837
+ "33": {
838
+ "name": "keyword.operator.plus.exponent.hexadecimal.go"
839
+ },
840
+ "34": {
841
+ "name": "keyword.operator.minus.exponent.hexadecimal.go"
842
+ },
843
+ "35": {
844
+ "name": "constant.numeric.exponent.hexadecimal.go",
845
+ "patterns": [
846
+ {
847
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
848
+ "name": "punctuation.separator.constant.numeric.go"
849
+ }
850
+ ]
851
+ },
852
+ "36": {
853
+ "name": "keyword.other.unit.imaginary.go"
854
+ },
855
+ "37": {
856
+ "name": "keyword.other.unit.hexadecimal.go"
857
+ },
858
+ "38": {
859
+ "name": "constant.numeric.hexadecimal.go",
860
+ "patterns": [
861
+ {
862
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
863
+ "name": "punctuation.separator.constant.numeric.go"
864
+ }
865
+ ]
866
+ },
867
+ "39": {
868
+ "name": "punctuation.separator.constant.numeric.go"
869
+ },
870
+ "40": {
871
+ "name": "keyword.other.unit.exponent.hexadecimal.go"
872
+ },
873
+ "41": {
874
+ "name": "keyword.operator.plus.exponent.hexadecimal.go"
875
+ },
876
+ "42": {
877
+ "name": "keyword.operator.minus.exponent.hexadecimal.go"
878
+ },
879
+ "43": {
880
+ "name": "constant.numeric.exponent.hexadecimal.go",
881
+ "patterns": [
882
+ {
883
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
884
+ "name": "punctuation.separator.constant.numeric.go"
885
+ }
886
+ ]
887
+ },
888
+ "44": {
889
+ "name": "keyword.other.unit.imaginary.go"
890
+ },
891
+ "45": {
892
+ "name": "keyword.other.unit.hexadecimal.go"
893
+ },
894
+ "46": {
895
+ "name": "constant.numeric.hexadecimal.go"
896
+ },
897
+ "47": {
898
+ "name": "constant.numeric.hexadecimal.go",
899
+ "patterns": [
900
+ {
901
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
902
+ "name": "punctuation.separator.constant.numeric.go"
903
+ }
904
+ ]
905
+ },
906
+ "48": {
907
+ "name": "punctuation.separator.constant.numeric.go"
908
+ },
909
+ "49": {
910
+ "name": "keyword.other.unit.exponent.hexadecimal.go"
911
+ },
912
+ "50": {
913
+ "name": "keyword.operator.plus.exponent.hexadecimal.go"
914
+ },
915
+ "51": {
916
+ "name": "keyword.operator.minus.exponent.hexadecimal.go"
917
+ },
918
+ "52": {
919
+ "name": "constant.numeric.exponent.hexadecimal.go",
920
+ "patterns": [
921
+ {
922
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
923
+ "name": "punctuation.separator.constant.numeric.go"
924
+ }
925
+ ]
926
+ },
927
+ "53": {
928
+ "name": "keyword.other.unit.imaginary.go"
929
+ }
930
+ }
931
+ },
932
+ {
933
+ "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|$))",
934
+ "captures": {
935
+ "1": {
936
+ "name": "constant.numeric.decimal.go",
937
+ "patterns": [
938
+ {
939
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
940
+ "name": "punctuation.separator.constant.numeric.go"
941
+ }
942
+ ]
943
+ },
944
+ "2": {
945
+ "name": "punctuation.separator.constant.numeric.go"
946
+ },
947
+ "3": {
948
+ "name": "keyword.other.unit.imaginary.go"
949
+ },
950
+ "4": {
951
+ "name": "keyword.other.unit.binary.go"
952
+ },
953
+ "5": {
954
+ "name": "constant.numeric.binary.go",
955
+ "patterns": [
956
+ {
957
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
958
+ "name": "punctuation.separator.constant.numeric.go"
959
+ }
960
+ ]
961
+ },
962
+ "6": {
963
+ "name": "punctuation.separator.constant.numeric.go"
964
+ },
965
+ "7": {
966
+ "name": "keyword.other.unit.imaginary.go"
967
+ },
968
+ "8": {
969
+ "name": "keyword.other.unit.octal.go"
970
+ },
971
+ "9": {
972
+ "name": "constant.numeric.octal.go",
973
+ "patterns": [
974
+ {
975
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
976
+ "name": "punctuation.separator.constant.numeric.go"
977
+ }
978
+ ]
979
+ },
980
+ "10": {
981
+ "name": "punctuation.separator.constant.numeric.go"
982
+ },
983
+ "11": {
984
+ "name": "keyword.other.unit.imaginary.go"
985
+ },
986
+ "12": {
987
+ "name": "keyword.other.unit.hexadecimal.go"
988
+ },
989
+ "13": {
990
+ "name": "constant.numeric.hexadecimal.go",
991
+ "patterns": [
992
+ {
993
+ "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
994
+ "name": "punctuation.separator.constant.numeric.go"
995
+ }
996
+ ]
997
+ },
998
+ "14": {
999
+ "name": "punctuation.separator.constant.numeric.go"
1000
+ },
1001
+ "15": {
1002
+ "name": "keyword.other.unit.imaginary.go"
1003
+ }
1004
+ }
1005
+ },
1006
+ {
1007
+ "match": "(?:(?:[0-9a-zA-Z_\\.])|(?<=[eEpP])[+-])+",
1008
+ "name": "invalid.illegal.constant.numeric.go"
1009
+ }
1010
+ ]
1011
+ }
1012
+ ]
1013
+ }
1014
+ }
1015
+ }
1016
+ }
1017
+ }
package/index.js ADDED
@@ -0,0 +1,7 @@
1
+ import { registerExtension } from 'vscode/extensions';
2
+
3
+ var manifest = {name:"go",displayName:"Go Language Basics",description:"Provides syntax highlighting and bracket matching in Go files.",version:"1.0.0",publisher:"vscode",license:"MIT",engines:{vscode:"*"},scripts:{"update-grammar":"node ../node_modules/vscode-grammar-updater/bin jeff-hykin/better-go-syntax export/generated.tmLanguage.json ./syntaxes/go.tmLanguage.json"},contributes:{languages:[{id:"go",extensions:[".go"],aliases:["Go"],configuration:"./language-configuration.json"}],grammars:[{language:"go",scopeName:"source.go",path:"./syntaxes/go.tmLanguage.json"}],configurationDefaults:{"[go]":{"editor.insertSpaces":false}}},repository:{type:"git",url:"https://github.com/microsoft/vscode.git"},main:undefined};
4
+
5
+ const { registerFileUrl } = registerExtension(manifest);
6
+ registerFileUrl('./syntaxes/go.tmLanguage.json', new URL('./go.tmLanguage.json', import.meta.url).toString(), 'application/json');
7
+ registerFileUrl('./language-configuration.json', new URL('./language-configuration.json', import.meta.url).toString(), 'application/json');
@@ -0,0 +1,37 @@
1
+ {
2
+ "comments": {
3
+ "lineComment": "//",
4
+ "blockComment": [ "/*", "*/" ]
5
+ },
6
+ "brackets": [
7
+ ["{", "}"],
8
+ ["[", "]"],
9
+ ["(", ")"]
10
+ ],
11
+ "autoClosingPairs": [
12
+ ["{", "}"],
13
+ ["[", "]"],
14
+ ["(", ")"],
15
+ { "open": "`", "close": "`", "notIn": ["string"]},
16
+ { "open": "\"", "close": "\"", "notIn": ["string"]},
17
+ { "open": "'", "close": "'", "notIn": ["string", "comment"]}
18
+ ],
19
+ "surroundingPairs": [
20
+ ["{", "}"],
21
+ ["[", "]"],
22
+ ["(", ")"],
23
+ ["\"", "\""],
24
+ ["'", "'"],
25
+ ["`", "`"]
26
+ ],
27
+ "indentationRules": {
28
+ "increaseIndentPattern": "^.*(\\bcase\\b.*:|\\bdefault\\b:|(\\b(func|if|else|switch|select|for|struct)\\b.*)?{[^}\"'`]*|\\([^)\"'`]*)$",
29
+ "decreaseIndentPattern": "^\\s*(\\bcase\\b.*:|\\bdefault\\b:|}[)}]*[),]?|\\)[,]?)$"
30
+ },
31
+ "folding": {
32
+ "markers": {
33
+ "start": "^\\s*//\\s*#?region\\b",
34
+ "end": "^\\s*//\\s*#?endregion\\b"
35
+ }
36
+ }
37
+ }
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@codingame/monaco-vscode-go-default-extension",
3
+ "version": "1.81.8-next.1",
4
+ "keywords": [],
5
+ "author": {
6
+ "name": "CodinGame",
7
+ "url": "http://www.codingame.com"
8
+ },
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/CodinGame/monaco-vscode-api"
13
+ },
14
+ "type": "module",
15
+ "private": false,
16
+ "description": "Default VSCode extension designed to be used with @codingame/monaco-vscode-api",
17
+ "main": "index.js",
18
+ "module": "index.js",
19
+ "dependencies": {
20
+ "vscode": "npm:@codingame/monaco-vscode-api@1.81.8-next.1"
21
+ }
22
+ }