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