chamba 0.7.0 → 0.8.0

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.
Files changed (120) hide show
  1. package/LICENSE +53 -14
  2. package/README.md +28 -8
  3. package/dist/commands/advanced.js +7 -278
  4. package/dist/commands/dev.js +11 -612
  5. package/dist/commands/doctor.js +1 -29
  6. package/dist/commands/menu.js +1 -80
  7. package/dist/commands/onboard.js +6 -230
  8. package/dist/commands/settings.js +15 -349
  9. package/dist/lib/agent-commands.js +2 -0
  10. package/dist/lib/agent-context.js +6 -210
  11. package/dist/lib/browser.js +1 -40
  12. package/dist/lib/chamba-yaml.js +10 -191
  13. package/dist/lib/constants.js +1 -125
  14. package/dist/lib/dockerfile-builder.js +41 -261
  15. package/dist/lib/env.js +2 -78
  16. package/dist/lib/git-env.js +1 -21
  17. package/dist/lib/global-config.js +4 -66
  18. package/dist/lib/pnpm-store.js +1 -19
  19. package/dist/lib/ports.js +1 -210
  20. package/dist/lib/safe-rm.js +1 -36
  21. package/dist/lib/sessions.js +2 -34
  22. package/dist/lib/shadows.js +1 -176
  23. package/dist/lib/skills.js +2 -0
  24. package/dist/lib/templates.js +1 -0
  25. package/dist/lib/webterm.js +1 -305
  26. package/dist/lib/workspace-identity.js +4 -260
  27. package/package.json +4 -4
  28. package/templates/Dockerfile +12 -19
  29. package/templates/claude-statusline.sh +5 -7
  30. package/templates/context/baseline.md +2 -0
  31. package/templates/pane-apps/client/assets/c-BNa-DeUl.json +3552 -0
  32. package/templates/pane-apps/client/assets/cpp-B-T4NRoH.json +20239 -0
  33. package/templates/pane-apps/client/assets/csharp-BbxHChhA.json +6010 -0
  34. package/templates/pane-apps/client/assets/css-CWCxuwmz.json +1860 -0
  35. package/templates/pane-apps/client/assets/diff-B-2N89g8.json +154 -0
  36. package/templates/pane-apps/client/assets/docker-DWTvYW26.json +103 -0
  37. package/templates/pane-apps/client/assets/files-D0nJgFAA.js +12 -0
  38. package/templates/pane-apps/client/assets/files-h0K1vZyQ.css +1 -0
  39. package/templates/pane-apps/client/assets/go-B2hyYeNg.json +3156 -0
  40. package/templates/pane-apps/client/assets/graphql-Z6Id2aNO.json +1292 -0
  41. package/templates/pane-apps/client/assets/html-BtzvlIfu.json +2627 -0
  42. package/templates/pane-apps/client/assets/ini-Bn3Twap1.json +108 -0
  43. package/templates/pane-apps/client/assets/java-C7t2dwLO.json +1885 -0
  44. package/templates/pane-apps/client/assets/javascript-DuC2v0C0.json +5996 -0
  45. package/templates/pane-apps/client/assets/json-CwdkWeV5.json +206 -0
  46. package/templates/pane-apps/client/assets/jsonc-MYWDbTU3.json +206 -0
  47. package/templates/pane-apps/client/assets/jsx-Cn8EZuIC.json +5996 -0
  48. package/templates/pane-apps/client/assets/kotlin-CFNOz1gw.json +580 -0
  49. package/templates/pane-apps/client/assets/make-BVnlFCcl.json +629 -0
  50. package/templates/pane-apps/client/assets/markdown-B4Xk2WM_.json +3263 -0
  51. package/templates/pane-apps/client/assets/php-CAQzQmmI.json +4188 -0
  52. package/templates/pane-apps/client/assets/python-CYQee8m4.json +4174 -0
  53. package/templates/pane-apps/client/assets/reviews-BsoGZ35r.css +1 -0
  54. package/templates/pane-apps/client/assets/reviews-iW0Mbn4e.js +153 -0
  55. package/templates/pane-apps/client/assets/ruby-D7R58tus.json +3114 -0
  56. package/templates/pane-apps/client/assets/rust-BFBbFiei.json +1103 -0
  57. package/templates/pane-apps/client/assets/scss-TQRhBkPG.json +1874 -0
  58. package/templates/pane-apps/client/assets/shellscript-DieAkC4W.json +2375 -0
  59. package/templates/pane-apps/client/assets/specs-D9z3neR-.js +13 -0
  60. package/templates/pane-apps/client/assets/sql-Bxd030LV.json +634 -0
  61. package/templates/pane-apps/client/assets/toml-ChrKGzsV.json +430 -0
  62. package/templates/pane-apps/client/assets/tsx-D2e90MFw.json +5996 -0
  63. package/templates/pane-apps/client/assets/typescript-DonXQ_n1.json +5747 -0
  64. package/templates/pane-apps/client/assets/xml-B17r2RXF.json +382 -0
  65. package/templates/pane-apps/client/assets/yaml-CKn4h1zy.json +627 -0
  66. package/templates/pane-apps/client/reviews/index.html +15 -0
  67. package/templates/pane-apps/client/specs/index.html +3 -2
  68. package/templates/pane-apps/server/reviews.mjs +20 -0
  69. package/templates/pane-apps/server/specs.mjs +5 -1588
  70. package/templates/skills/chamba-statusline/SKILL.md +7 -19
  71. package/templates/skills/dx-review/SKILL.md +123 -0
  72. package/templates/skills/dx-review/references/acts.md +162 -0
  73. package/templates/skills/dx-spec/SKILL.md +223 -27
  74. package/templates/skills/dx-spec/references/principles-template.md +2 -0
  75. package/templates/skills/dx-spec/references/review-guide.md +4 -50
  76. package/templates/skills/dx-spec/references/spec-guide.md +24 -4
  77. package/templates/skills/dx-spec/references/stages.md +143 -58
  78. package/templates/skills/dx-spec-execute/SKILL.md +148 -35
  79. package/templates/startup.mjs +10 -4
  80. package/templates/tool-helper.sh +166 -0
  81. package/templates/webterm/README.md +60 -26
  82. package/templates/webterm/color.js +61 -0
  83. package/templates/webterm/config.js +35 -4
  84. package/templates/webterm/context/claude.md +0 -1
  85. package/templates/webterm/public/app/alerts.js +4 -4
  86. package/templates/webterm/public/app/anchored.js +81 -0
  87. package/templates/webterm/public/app/connection.js +9 -0
  88. package/templates/webterm/public/app/dom.js +2 -0
  89. package/templates/webterm/public/app/frames.js +51 -17
  90. package/templates/webterm/public/app/main.js +22 -8
  91. package/templates/webterm/public/app/new-session.js +13 -41
  92. package/templates/webterm/public/app/palette.js +58 -0
  93. package/templates/webterm/public/app/pane-shape.js +167 -0
  94. package/templates/webterm/public/app/pane-shell.js +199 -134
  95. package/templates/webterm/public/app/pane.js +33 -24
  96. package/templates/webterm/public/app/reviews-host.js +15 -0
  97. package/templates/webterm/public/app/specs-host.js +12 -218
  98. package/templates/webterm/public/app/state.js +5 -0
  99. package/templates/webterm/public/app/tabs.js +6 -2
  100. package/templates/webterm/public/app/theme.js +75 -27
  101. package/templates/webterm/public/app/tool-host.js +302 -0
  102. package/templates/webterm/public/app/workspace-color.js +192 -0
  103. package/templates/webterm/public/index.html +17 -3
  104. package/templates/webterm/public/styles.css +143 -21
  105. package/templates/webterm/server.js +198 -150
  106. package/templates/webterm/tools/commands.js +61 -0
  107. package/templates/webterm/tools/index.js +25 -0
  108. package/templates/webterm/tools/mount.js +337 -0
  109. package/templates/webterm/tools/paths.js +34 -0
  110. package/templates/webterm/tools/reviews.js +133 -0
  111. package/templates/webterm/tools/specs.js +154 -0
  112. package/templates/webterm/typed-line.js +70 -7
  113. package/templates/context/context-usage.md +0 -1
  114. package/templates/context-usage.sh +0 -266
  115. package/templates/pane-apps/client/assets/specs-B1970L17.css +0 -1
  116. package/templates/pane-apps/client/assets/specs-cEee_SPn.js +0 -23
  117. package/templates/skills/dx-spec-config/SKILL.md +0 -313
  118. package/templates/skills/dx-spec-config/references/principles-template.md +0 -12
  119. package/templates/specs.sh +0 -106
  120. package/templates/webterm/specs.js +0 -358
@@ -0,0 +1,1103 @@
1
+ {
2
+ "displayName": "Rust",
3
+ "name": "rust",
4
+ "patterns": [
5
+ {
6
+ "begin": "(<)(\\[)",
7
+ "beginCaptures": {
8
+ "1": {
9
+ "name": "punctuation.brackets.angle.rust"
10
+ },
11
+ "2": {
12
+ "name": "punctuation.brackets.square.rust"
13
+ }
14
+ },
15
+ "end": ">",
16
+ "endCaptures": {
17
+ "0": {
18
+ "name": "punctuation.brackets.angle.rust"
19
+ }
20
+ },
21
+ "patterns": [
22
+ {
23
+ "include": "#block-comments"
24
+ },
25
+ {
26
+ "include": "#comments"
27
+ },
28
+ {
29
+ "include": "#gtypes"
30
+ },
31
+ {
32
+ "include": "#lvariables"
33
+ },
34
+ {
35
+ "include": "#lifetimes"
36
+ },
37
+ {
38
+ "include": "#punctuation"
39
+ },
40
+ {
41
+ "include": "#types"
42
+ }
43
+ ]
44
+ },
45
+ {
46
+ "captures": {
47
+ "1": {
48
+ "name": "keyword.operator.macro.dollar.rust"
49
+ },
50
+ "3": {
51
+ "name": "keyword.other.crate.rust"
52
+ },
53
+ "4": {
54
+ "name": "entity.name.type.metavariable.rust"
55
+ },
56
+ "6": {
57
+ "name": "keyword.operator.key-value.rust"
58
+ },
59
+ "7": {
60
+ "name": "variable.other.metavariable.specifier.rust"
61
+ }
62
+ },
63
+ "match": "(\\$)((crate)|([A-Z]\\w*))(\\s*(:)\\s*(block|expr(?:_2021)?|ident|item|lifetime|literal|meta|pat(?:_param)?|path|stmt|tt|ty|vis)\\b)?",
64
+ "name": "meta.macro.metavariable.type.rust",
65
+ "patterns": [
66
+ {
67
+ "include": "#keywords"
68
+ }
69
+ ]
70
+ },
71
+ {
72
+ "captures": {
73
+ "1": {
74
+ "name": "keyword.operator.macro.dollar.rust"
75
+ },
76
+ "2": {
77
+ "name": "variable.other.metavariable.name.rust"
78
+ },
79
+ "4": {
80
+ "name": "keyword.operator.key-value.rust"
81
+ },
82
+ "5": {
83
+ "name": "variable.other.metavariable.specifier.rust"
84
+ }
85
+ },
86
+ "match": "(\\$)([a-z]\\w*)(\\s*(:)\\s*(block|expr(?:_2021)?|ident|item|lifetime|literal|meta|pat(?:_param)?|path|stmt|tt|ty|vis)\\b)?",
87
+ "name": "meta.macro.metavariable.rust",
88
+ "patterns": [
89
+ {
90
+ "include": "#keywords"
91
+ }
92
+ ]
93
+ },
94
+ {
95
+ "captures": {
96
+ "1": {
97
+ "name": "entity.name.function.macro.rules.rust"
98
+ },
99
+ "3": {
100
+ "name": "entity.name.function.macro.rust"
101
+ },
102
+ "4": {
103
+ "name": "entity.name.type.macro.rust"
104
+ },
105
+ "5": {
106
+ "name": "punctuation.brackets.curly.rust"
107
+ }
108
+ },
109
+ "match": "\\b(macro_rules!)\\s+(([0-9_a-z]+)|([A-Z][0-9_a-z]*))\\s+(\\{)",
110
+ "name": "meta.macro.rules.rust"
111
+ },
112
+ {
113
+ "captures": {
114
+ "1": {
115
+ "name": "storage.type.rust"
116
+ },
117
+ "2": {
118
+ "name": "entity.name.module.rust"
119
+ }
120
+ },
121
+ "match": "(mod)\\s+((?:r#(?!crate|[Ss]elf|super))?[a-z][0-9A-Z_a-z]*)"
122
+ },
123
+ {
124
+ "begin": "\\b(extern)\\s+(crate)",
125
+ "beginCaptures": {
126
+ "1": {
127
+ "name": "storage.type.rust"
128
+ },
129
+ "2": {
130
+ "name": "keyword.other.crate.rust"
131
+ }
132
+ },
133
+ "end": ";",
134
+ "endCaptures": {
135
+ "0": {
136
+ "name": "punctuation.semi.rust"
137
+ }
138
+ },
139
+ "name": "meta.import.rust",
140
+ "patterns": [
141
+ {
142
+ "include": "#block-comments"
143
+ },
144
+ {
145
+ "include": "#comments"
146
+ },
147
+ {
148
+ "include": "#keywords"
149
+ },
150
+ {
151
+ "include": "#punctuation"
152
+ }
153
+ ]
154
+ },
155
+ {
156
+ "begin": "\\b(use)\\s",
157
+ "beginCaptures": {
158
+ "1": {
159
+ "name": "keyword.other.rust"
160
+ }
161
+ },
162
+ "end": ";",
163
+ "endCaptures": {
164
+ "0": {
165
+ "name": "punctuation.semi.rust"
166
+ }
167
+ },
168
+ "name": "meta.use.rust",
169
+ "patterns": [
170
+ {
171
+ "include": "#block-comments"
172
+ },
173
+ {
174
+ "include": "#comments"
175
+ },
176
+ {
177
+ "include": "#keywords"
178
+ },
179
+ {
180
+ "include": "#namespaces"
181
+ },
182
+ {
183
+ "include": "#punctuation"
184
+ },
185
+ {
186
+ "include": "#types"
187
+ },
188
+ {
189
+ "include": "#lvariables"
190
+ }
191
+ ]
192
+ },
193
+ {
194
+ "include": "#block-comments"
195
+ },
196
+ {
197
+ "include": "#comments"
198
+ },
199
+ {
200
+ "include": "#attributes"
201
+ },
202
+ {
203
+ "include": "#lvariables"
204
+ },
205
+ {
206
+ "include": "#constants"
207
+ },
208
+ {
209
+ "include": "#gtypes"
210
+ },
211
+ {
212
+ "include": "#functions"
213
+ },
214
+ {
215
+ "include": "#types"
216
+ },
217
+ {
218
+ "include": "#keywords"
219
+ },
220
+ {
221
+ "include": "#lifetimes"
222
+ },
223
+ {
224
+ "include": "#macros"
225
+ },
226
+ {
227
+ "include": "#namespaces"
228
+ },
229
+ {
230
+ "include": "#punctuation"
231
+ },
232
+ {
233
+ "include": "#strings"
234
+ },
235
+ {
236
+ "include": "#variables"
237
+ }
238
+ ],
239
+ "repository": {
240
+ "attributes": {
241
+ "begin": "(#)(!?)(\\[)",
242
+ "beginCaptures": {
243
+ "1": {
244
+ "name": "punctuation.definition.attribute.rust"
245
+ },
246
+ "3": {
247
+ "name": "punctuation.brackets.attribute.rust"
248
+ }
249
+ },
250
+ "end": "]",
251
+ "endCaptures": {
252
+ "0": {
253
+ "name": "punctuation.brackets.attribute.rust"
254
+ }
255
+ },
256
+ "name": "meta.attribute.rust",
257
+ "patterns": [
258
+ {
259
+ "include": "#block-comments"
260
+ },
261
+ {
262
+ "include": "#comments"
263
+ },
264
+ {
265
+ "include": "#keywords"
266
+ },
267
+ {
268
+ "include": "#lifetimes"
269
+ },
270
+ {
271
+ "include": "#punctuation"
272
+ },
273
+ {
274
+ "include": "#strings"
275
+ },
276
+ {
277
+ "include": "#gtypes"
278
+ },
279
+ {
280
+ "include": "#types"
281
+ }
282
+ ]
283
+ },
284
+ "block-comments": {
285
+ "patterns": [
286
+ {
287
+ "match": "/\\*\\*/",
288
+ "name": "comment.block.rust"
289
+ },
290
+ {
291
+ "begin": "/\\*\\*",
292
+ "end": "\\*/",
293
+ "name": "comment.block.documentation.rust",
294
+ "patterns": [
295
+ {
296
+ "include": "#block-comments"
297
+ }
298
+ ]
299
+ },
300
+ {
301
+ "begin": "/\\*(?!\\*)",
302
+ "end": "\\*/",
303
+ "name": "comment.block.rust",
304
+ "patterns": [
305
+ {
306
+ "include": "#block-comments"
307
+ }
308
+ ]
309
+ }
310
+ ]
311
+ },
312
+ "comments": {
313
+ "patterns": [
314
+ {
315
+ "captures": {
316
+ "1": {
317
+ "name": "punctuation.definition.comment.rust"
318
+ }
319
+ },
320
+ "match": "(///).*$",
321
+ "name": "comment.line.documentation.rust"
322
+ },
323
+ {
324
+ "captures": {
325
+ "1": {
326
+ "name": "punctuation.definition.comment.rust"
327
+ }
328
+ },
329
+ "match": "(//).*$",
330
+ "name": "comment.line.double-slash.rust"
331
+ }
332
+ ]
333
+ },
334
+ "constants": {
335
+ "patterns": [
336
+ {
337
+ "match": "\\b[A-Z]{2}[0-9A-Z_]*\\b",
338
+ "name": "constant.other.caps.rust"
339
+ },
340
+ {
341
+ "captures": {
342
+ "1": {
343
+ "name": "storage.type.rust"
344
+ },
345
+ "2": {
346
+ "name": "constant.other.caps.rust"
347
+ }
348
+ },
349
+ "match": "\\b(const)\\s+([A-Z][0-9A-Z_a-z]*)\\b"
350
+ },
351
+ {
352
+ "captures": {
353
+ "1": {
354
+ "name": "punctuation.separator.dot.decimal.rust"
355
+ },
356
+ "2": {
357
+ "name": "keyword.operator.exponent.rust"
358
+ },
359
+ "3": {
360
+ "name": "keyword.operator.exponent.sign.rust"
361
+ },
362
+ "4": {
363
+ "name": "constant.numeric.decimal.exponent.mantissa.rust"
364
+ },
365
+ "5": {
366
+ "name": "entity.name.type.numeric.rust"
367
+ }
368
+ },
369
+ "match": "\\b\\d[_\\d]*(\\.?)[_\\d]*(?:([Ee])([-+]?)([_\\d]+))?(f32|f64|i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\b",
370
+ "name": "constant.numeric.decimal.rust"
371
+ },
372
+ {
373
+ "captures": {
374
+ "1": {
375
+ "name": "entity.name.type.numeric.rust"
376
+ }
377
+ },
378
+ "match": "\\b0x[A-F_a-f\\d]+(i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\b",
379
+ "name": "constant.numeric.hex.rust"
380
+ },
381
+ {
382
+ "captures": {
383
+ "1": {
384
+ "name": "entity.name.type.numeric.rust"
385
+ }
386
+ },
387
+ "match": "\\b0o[0-7_]+(i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\b",
388
+ "name": "constant.numeric.oct.rust"
389
+ },
390
+ {
391
+ "captures": {
392
+ "1": {
393
+ "name": "entity.name.type.numeric.rust"
394
+ }
395
+ },
396
+ "match": "\\b0b[01_]+(i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\b",
397
+ "name": "constant.numeric.bin.rust"
398
+ },
399
+ {
400
+ "match": "\\b(true|false)\\b",
401
+ "name": "constant.language.bool.rust"
402
+ }
403
+ ]
404
+ },
405
+ "escapes": {
406
+ "captures": {
407
+ "1": {
408
+ "name": "constant.character.escape.backslash.rust"
409
+ },
410
+ "2": {
411
+ "name": "constant.character.escape.bit.rust"
412
+ },
413
+ "3": {
414
+ "name": "constant.character.escape.unicode.rust"
415
+ },
416
+ "4": {
417
+ "name": "constant.character.escape.unicode.punctuation.rust"
418
+ },
419
+ "5": {
420
+ "name": "constant.character.escape.unicode.punctuation.rust"
421
+ }
422
+ },
423
+ "match": "(\\\\)(?:(x[0-7][A-Fa-f\\d])|(u(\\{)[A-Fa-f\\d]{4,6}(}))|.)",
424
+ "name": "constant.character.escape.rust"
425
+ },
426
+ "functions": {
427
+ "patterns": [
428
+ {
429
+ "captures": {
430
+ "1": {
431
+ "name": "keyword.other.rust"
432
+ },
433
+ "2": {
434
+ "name": "punctuation.brackets.round.rust"
435
+ }
436
+ },
437
+ "match": "\\b(pub)(\\()"
438
+ },
439
+ {
440
+ "begin": "\\b(fn)\\s+((?:r#(?!crate|[Ss]elf|super))?[0-9A-Z_a-z]+)((\\()|(<))",
441
+ "beginCaptures": {
442
+ "1": {
443
+ "name": "keyword.other.fn.rust"
444
+ },
445
+ "2": {
446
+ "name": "entity.name.function.rust"
447
+ },
448
+ "4": {
449
+ "name": "punctuation.brackets.round.rust"
450
+ },
451
+ "5": {
452
+ "name": "punctuation.brackets.angle.rust"
453
+ }
454
+ },
455
+ "end": "(\\{)|(;)",
456
+ "endCaptures": {
457
+ "1": {
458
+ "name": "punctuation.brackets.curly.rust"
459
+ },
460
+ "2": {
461
+ "name": "punctuation.semi.rust"
462
+ }
463
+ },
464
+ "name": "meta.function.definition.rust",
465
+ "patterns": [
466
+ {
467
+ "include": "#block-comments"
468
+ },
469
+ {
470
+ "include": "#comments"
471
+ },
472
+ {
473
+ "include": "#keywords"
474
+ },
475
+ {
476
+ "include": "#lvariables"
477
+ },
478
+ {
479
+ "include": "#constants"
480
+ },
481
+ {
482
+ "include": "#gtypes"
483
+ },
484
+ {
485
+ "include": "#functions"
486
+ },
487
+ {
488
+ "include": "#lifetimes"
489
+ },
490
+ {
491
+ "include": "#macros"
492
+ },
493
+ {
494
+ "include": "#namespaces"
495
+ },
496
+ {
497
+ "include": "#punctuation"
498
+ },
499
+ {
500
+ "include": "#strings"
501
+ },
502
+ {
503
+ "include": "#types"
504
+ },
505
+ {
506
+ "include": "#variables"
507
+ }
508
+ ]
509
+ },
510
+ {
511
+ "begin": "((?:r#(?!crate|[Ss]elf|super))?[0-9A-Z_a-z]+)(\\()",
512
+ "beginCaptures": {
513
+ "1": {
514
+ "name": "entity.name.function.rust"
515
+ },
516
+ "2": {
517
+ "name": "punctuation.brackets.round.rust"
518
+ }
519
+ },
520
+ "end": "\\)",
521
+ "endCaptures": {
522
+ "0": {
523
+ "name": "punctuation.brackets.round.rust"
524
+ }
525
+ },
526
+ "name": "meta.function.call.rust",
527
+ "patterns": [
528
+ {
529
+ "include": "#block-comments"
530
+ },
531
+ {
532
+ "include": "#comments"
533
+ },
534
+ {
535
+ "include": "#attributes"
536
+ },
537
+ {
538
+ "include": "#keywords"
539
+ },
540
+ {
541
+ "include": "#lvariables"
542
+ },
543
+ {
544
+ "include": "#constants"
545
+ },
546
+ {
547
+ "include": "#gtypes"
548
+ },
549
+ {
550
+ "include": "#functions"
551
+ },
552
+ {
553
+ "include": "#lifetimes"
554
+ },
555
+ {
556
+ "include": "#macros"
557
+ },
558
+ {
559
+ "include": "#namespaces"
560
+ },
561
+ {
562
+ "include": "#punctuation"
563
+ },
564
+ {
565
+ "include": "#strings"
566
+ },
567
+ {
568
+ "include": "#types"
569
+ },
570
+ {
571
+ "include": "#variables"
572
+ }
573
+ ]
574
+ },
575
+ {
576
+ "begin": "((?:r#(?!crate|[Ss]elf|super))?[0-9A-Z_a-z]+)(?=::<.*>\\()",
577
+ "beginCaptures": {
578
+ "1": {
579
+ "name": "entity.name.function.rust"
580
+ }
581
+ },
582
+ "end": "\\)",
583
+ "endCaptures": {
584
+ "0": {
585
+ "name": "punctuation.brackets.round.rust"
586
+ }
587
+ },
588
+ "name": "meta.function.call.rust",
589
+ "patterns": [
590
+ {
591
+ "include": "#block-comments"
592
+ },
593
+ {
594
+ "include": "#comments"
595
+ },
596
+ {
597
+ "include": "#attributes"
598
+ },
599
+ {
600
+ "include": "#keywords"
601
+ },
602
+ {
603
+ "include": "#lvariables"
604
+ },
605
+ {
606
+ "include": "#constants"
607
+ },
608
+ {
609
+ "include": "#gtypes"
610
+ },
611
+ {
612
+ "include": "#functions"
613
+ },
614
+ {
615
+ "include": "#lifetimes"
616
+ },
617
+ {
618
+ "include": "#macros"
619
+ },
620
+ {
621
+ "include": "#namespaces"
622
+ },
623
+ {
624
+ "include": "#punctuation"
625
+ },
626
+ {
627
+ "include": "#strings"
628
+ },
629
+ {
630
+ "include": "#types"
631
+ },
632
+ {
633
+ "include": "#variables"
634
+ }
635
+ ]
636
+ }
637
+ ]
638
+ },
639
+ "gtypes": {
640
+ "patterns": [
641
+ {
642
+ "match": "\\b(Some|None)\\b",
643
+ "name": "entity.name.type.option.rust"
644
+ },
645
+ {
646
+ "match": "\\b(Ok|Err)\\b",
647
+ "name": "entity.name.type.result.rust"
648
+ }
649
+ ]
650
+ },
651
+ "interpolations": {
652
+ "captures": {
653
+ "1": {
654
+ "name": "punctuation.definition.interpolation.rust"
655
+ },
656
+ "2": {
657
+ "name": "punctuation.definition.interpolation.rust"
658
+ }
659
+ },
660
+ "match": "(\\{)[^\"{}]*(})",
661
+ "name": "meta.interpolation.rust"
662
+ },
663
+ "keywords": {
664
+ "patterns": [
665
+ {
666
+ "match": "\\b(await|break|continue|do|else|for|if|loop|match|return|try|while|yield)\\b",
667
+ "name": "keyword.control.rust"
668
+ },
669
+ {
670
+ "match": "\\b(extern|let|macro|mod)\\b",
671
+ "name": "keyword.other.rust storage.type.rust"
672
+ },
673
+ {
674
+ "match": "\\b(const)\\b",
675
+ "name": "storage.modifier.rust"
676
+ },
677
+ {
678
+ "match": "\\b(type)\\b",
679
+ "name": "keyword.declaration.type.rust storage.type.rust"
680
+ },
681
+ {
682
+ "match": "\\b(enum)\\b",
683
+ "name": "keyword.declaration.enum.rust storage.type.rust"
684
+ },
685
+ {
686
+ "match": "\\b(trait)\\b",
687
+ "name": "keyword.declaration.trait.rust storage.type.rust"
688
+ },
689
+ {
690
+ "match": "\\b(struct)\\b",
691
+ "name": "keyword.declaration.struct.rust storage.type.rust"
692
+ },
693
+ {
694
+ "match": "\\b(abstract|static)\\b",
695
+ "name": "storage.modifier.rust"
696
+ },
697
+ {
698
+ "match": "\\b(as|async|become|box|dyn|move|final|gen|impl|in|override|priv|pub|ref|typeof|union|unsafe|unsized|use|virtual|where)\\b",
699
+ "name": "keyword.other.rust"
700
+ },
701
+ {
702
+ "match": "\\bfn\\b",
703
+ "name": "keyword.other.fn.rust"
704
+ },
705
+ {
706
+ "match": "\\bcrate\\b",
707
+ "name": "keyword.other.crate.rust"
708
+ },
709
+ {
710
+ "match": "\\bmut\\b",
711
+ "name": "storage.modifier.mut.rust"
712
+ },
713
+ {
714
+ "match": "([\\^|]|\\|\\||&&|<<|>>|!)(?!=)",
715
+ "name": "keyword.operator.logical.rust"
716
+ },
717
+ {
718
+ "match": "&(?![\\&=])",
719
+ "name": "keyword.operator.borrow.and.rust"
720
+ },
721
+ {
722
+ "match": "((?:[-%\\&*+/^|]|<<|>>)=)",
723
+ "name": "keyword.operator.assignment.rust"
724
+ },
725
+ {
726
+ "match": "(?<![<>])=(?![=>])",
727
+ "name": "keyword.operator.assignment.equal.rust"
728
+ },
729
+ {
730
+ "match": "(=(=)?(?!>)|!=|<=|(?<!=)>=)",
731
+ "name": "keyword.operator.comparison.rust"
732
+ },
733
+ {
734
+ "match": "(([%+]|(\\*(?!\\w)))(?!=))|(-(?!>))|(/(?!/))",
735
+ "name": "keyword.operator.math.rust"
736
+ },
737
+ {
738
+ "captures": {
739
+ "1": {
740
+ "name": "punctuation.brackets.round.rust"
741
+ },
742
+ "2": {
743
+ "name": "punctuation.brackets.square.rust"
744
+ },
745
+ "3": {
746
+ "name": "punctuation.brackets.curly.rust"
747
+ },
748
+ "4": {
749
+ "name": "keyword.operator.comparison.rust"
750
+ },
751
+ "5": {
752
+ "name": "punctuation.brackets.round.rust"
753
+ },
754
+ "6": {
755
+ "name": "punctuation.brackets.square.rust"
756
+ },
757
+ "7": {
758
+ "name": "punctuation.brackets.curly.rust"
759
+ }
760
+ },
761
+ "match": "(?:\\b|(?:(\\))|(])|(})))[\\t ]+([<>])[\\t ]+(?:\\b|(?:(\\()|(\\[)|(\\{)))"
762
+ },
763
+ {
764
+ "match": "::",
765
+ "name": "keyword.operator.namespace.rust"
766
+ },
767
+ {
768
+ "captures": {
769
+ "1": {
770
+ "name": "keyword.operator.dereference.rust"
771
+ }
772
+ },
773
+ "match": "(\\*)(?=\\w+)"
774
+ },
775
+ {
776
+ "match": "@",
777
+ "name": "keyword.operator.subpattern.rust"
778
+ },
779
+ {
780
+ "match": "\\.(?!\\.)",
781
+ "name": "keyword.operator.access.dot.rust"
782
+ },
783
+ {
784
+ "match": "\\.{2}([.=])?",
785
+ "name": "keyword.operator.range.rust"
786
+ },
787
+ {
788
+ "match": ":(?!:)",
789
+ "name": "keyword.operator.key-value.rust"
790
+ },
791
+ {
792
+ "match": "->|<-",
793
+ "name": "keyword.operator.arrow.skinny.rust"
794
+ },
795
+ {
796
+ "match": "=>",
797
+ "name": "keyword.operator.arrow.fat.rust"
798
+ },
799
+ {
800
+ "match": "\\$",
801
+ "name": "keyword.operator.macro.dollar.rust"
802
+ },
803
+ {
804
+ "match": "\\?",
805
+ "name": "keyword.operator.question.rust"
806
+ }
807
+ ]
808
+ },
809
+ "lifetimes": {
810
+ "patterns": [
811
+ {
812
+ "captures": {
813
+ "1": {
814
+ "name": "punctuation.definition.lifetime.rust"
815
+ },
816
+ "2": {
817
+ "name": "entity.name.type.lifetime.rust"
818
+ }
819
+ },
820
+ "match": "(')([A-Z_a-z][0-9A-Z_a-z]*)(?!')\\b"
821
+ },
822
+ {
823
+ "captures": {
824
+ "1": {
825
+ "name": "keyword.operator.borrow.rust"
826
+ },
827
+ "2": {
828
+ "name": "punctuation.definition.lifetime.rust"
829
+ },
830
+ "3": {
831
+ "name": "entity.name.type.lifetime.rust"
832
+ }
833
+ },
834
+ "match": "(&)(')([A-Z_a-z][0-9A-Z_a-z]*)(?!')\\b"
835
+ }
836
+ ]
837
+ },
838
+ "lvariables": {
839
+ "patterns": [
840
+ {
841
+ "match": "\\b[Ss]elf\\b",
842
+ "name": "variable.language.self.rust"
843
+ },
844
+ {
845
+ "match": "\\bsuper\\b",
846
+ "name": "variable.language.super.rust"
847
+ }
848
+ ]
849
+ },
850
+ "macros": {
851
+ "patterns": [
852
+ {
853
+ "captures": {
854
+ "2": {
855
+ "name": "entity.name.function.macro.rust"
856
+ },
857
+ "3": {
858
+ "name": "entity.name.type.macro.rust"
859
+ }
860
+ },
861
+ "match": "(([_a-z][0-9A-Z_a-z]*!)|([A-Z_][0-9A-Z_a-z]*!))",
862
+ "name": "meta.macro.rust"
863
+ }
864
+ ]
865
+ },
866
+ "namespaces": {
867
+ "patterns": [
868
+ {
869
+ "captures": {
870
+ "1": {
871
+ "name": "entity.name.namespace.rust"
872
+ },
873
+ "2": {
874
+ "name": "keyword.operator.namespace.rust"
875
+ }
876
+ },
877
+ "match": "(?<![0-9A-Z_a-z])([0-9A-Z_a-z]+)((?<!s(?:uper|elf))::)"
878
+ }
879
+ ]
880
+ },
881
+ "punctuation": {
882
+ "patterns": [
883
+ {
884
+ "match": ",",
885
+ "name": "punctuation.comma.rust"
886
+ },
887
+ {
888
+ "match": "[{}]",
889
+ "name": "punctuation.brackets.curly.rust"
890
+ },
891
+ {
892
+ "match": "[()]",
893
+ "name": "punctuation.brackets.round.rust"
894
+ },
895
+ {
896
+ "match": ";",
897
+ "name": "punctuation.semi.rust"
898
+ },
899
+ {
900
+ "match": "[]\\[]",
901
+ "name": "punctuation.brackets.square.rust"
902
+ },
903
+ {
904
+ "match": "(?<!=)[<>]",
905
+ "name": "punctuation.brackets.angle.rust"
906
+ }
907
+ ]
908
+ },
909
+ "strings": {
910
+ "patterns": [
911
+ {
912
+ "begin": "(b?)(\")",
913
+ "beginCaptures": {
914
+ "1": {
915
+ "name": "string.quoted.byte.raw.rust"
916
+ },
917
+ "2": {
918
+ "name": "punctuation.definition.string.rust"
919
+ }
920
+ },
921
+ "end": "\"",
922
+ "endCaptures": {
923
+ "0": {
924
+ "name": "punctuation.definition.string.rust"
925
+ }
926
+ },
927
+ "name": "string.quoted.double.rust",
928
+ "patterns": [
929
+ {
930
+ "include": "#escapes"
931
+ },
932
+ {
933
+ "include": "#interpolations"
934
+ }
935
+ ]
936
+ },
937
+ {
938
+ "begin": "(b?r)(#*)(\")",
939
+ "beginCaptures": {
940
+ "1": {
941
+ "name": "string.quoted.byte.raw.rust"
942
+ },
943
+ "2": {
944
+ "name": "punctuation.definition.string.raw.rust"
945
+ },
946
+ "3": {
947
+ "name": "punctuation.definition.string.rust"
948
+ }
949
+ },
950
+ "end": "(\")(\\2)",
951
+ "endCaptures": {
952
+ "1": {
953
+ "name": "punctuation.definition.string.rust"
954
+ },
955
+ "2": {
956
+ "name": "punctuation.definition.string.raw.rust"
957
+ }
958
+ },
959
+ "name": "string.quoted.double.rust"
960
+ },
961
+ {
962
+ "begin": "(b)?(')",
963
+ "beginCaptures": {
964
+ "1": {
965
+ "name": "string.quoted.byte.raw.rust"
966
+ },
967
+ "2": {
968
+ "name": "punctuation.definition.char.rust"
969
+ }
970
+ },
971
+ "end": "'",
972
+ "endCaptures": {
973
+ "0": {
974
+ "name": "punctuation.definition.char.rust"
975
+ }
976
+ },
977
+ "name": "string.quoted.single.char.rust",
978
+ "patterns": [
979
+ {
980
+ "include": "#escapes"
981
+ }
982
+ ]
983
+ }
984
+ ]
985
+ },
986
+ "types": {
987
+ "patterns": [
988
+ {
989
+ "captures": {
990
+ "1": {
991
+ "name": "entity.name.type.numeric.rust"
992
+ }
993
+ },
994
+ "match": "(?<![A-Za-z])(f32|f64|i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)\\b"
995
+ },
996
+ {
997
+ "begin": "\\b(_?[A-Z][0-9A-Z_a-z]*)(<)",
998
+ "beginCaptures": {
999
+ "1": {
1000
+ "name": "entity.name.type.rust"
1001
+ },
1002
+ "2": {
1003
+ "name": "punctuation.brackets.angle.rust"
1004
+ }
1005
+ },
1006
+ "end": ">",
1007
+ "endCaptures": {
1008
+ "0": {
1009
+ "name": "punctuation.brackets.angle.rust"
1010
+ }
1011
+ },
1012
+ "patterns": [
1013
+ {
1014
+ "include": "#block-comments"
1015
+ },
1016
+ {
1017
+ "include": "#comments"
1018
+ },
1019
+ {
1020
+ "include": "#keywords"
1021
+ },
1022
+ {
1023
+ "include": "#lvariables"
1024
+ },
1025
+ {
1026
+ "include": "#lifetimes"
1027
+ },
1028
+ {
1029
+ "include": "#punctuation"
1030
+ },
1031
+ {
1032
+ "include": "#types"
1033
+ },
1034
+ {
1035
+ "include": "#variables"
1036
+ }
1037
+ ]
1038
+ },
1039
+ {
1040
+ "match": "\\b(bool|char|str)\\b",
1041
+ "name": "entity.name.type.primitive.rust"
1042
+ },
1043
+ {
1044
+ "captures": {
1045
+ "1": {
1046
+ "name": "keyword.declaration.trait.rust storage.type.rust"
1047
+ },
1048
+ "2": {
1049
+ "name": "entity.name.type.trait.rust"
1050
+ }
1051
+ },
1052
+ "match": "\\b(trait)\\s+(_?[A-Z][0-9A-Z_a-z]*)\\b"
1053
+ },
1054
+ {
1055
+ "captures": {
1056
+ "1": {
1057
+ "name": "keyword.declaration.struct.rust storage.type.rust"
1058
+ },
1059
+ "2": {
1060
+ "name": "entity.name.type.struct.rust"
1061
+ }
1062
+ },
1063
+ "match": "\\b(struct)\\s+(_?[A-Z][0-9A-Z_a-z]*)\\b"
1064
+ },
1065
+ {
1066
+ "captures": {
1067
+ "1": {
1068
+ "name": "keyword.declaration.enum.rust storage.type.rust"
1069
+ },
1070
+ "2": {
1071
+ "name": "entity.name.type.enum.rust"
1072
+ }
1073
+ },
1074
+ "match": "\\b(enum)\\s+(_?[A-Z][0-9A-Z_a-z]*)\\b"
1075
+ },
1076
+ {
1077
+ "captures": {
1078
+ "1": {
1079
+ "name": "keyword.declaration.type.rust storage.type.rust"
1080
+ },
1081
+ "2": {
1082
+ "name": "entity.name.type.declaration.rust"
1083
+ }
1084
+ },
1085
+ "match": "\\b(type)\\s+(_?[A-Z][0-9A-Z_a-z]*)\\b"
1086
+ },
1087
+ {
1088
+ "match": "\\b_?[A-Z][0-9A-Z_a-z]*\\b(?!!)",
1089
+ "name": "entity.name.type.rust"
1090
+ }
1091
+ ]
1092
+ },
1093
+ "variables": {
1094
+ "patterns": [
1095
+ {
1096
+ "match": "\\b(?<!(?<!\\.)\\.)(?:r#(?!(crate|[Ss]elf|super)))?[0-9_a-z]+\\b",
1097
+ "name": "variable.other.rust"
1098
+ }
1099
+ ]
1100
+ }
1101
+ },
1102
+ "scopeName": "source.rust"
1103
+ }