PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.27.3
Code Block Pro – Beautiful Syntax Highlighting v1.27.3
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / languages / apex.tmLanguage.json

apex.tmLanguage.json in Code Block Pro – Beautiful Syntax Highlighting 1.27.3, at build/shiki/languages/apex.tmLanguage.json

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