@salesforce/apex-tmlanguage 1.8.2 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -175,6 +175,10 @@
175
175
  <key>include</key>
176
176
  <string>#method-declaration</string>
177
177
  </dict>
178
+ <dict>
179
+ <key>include</key>
180
+ <string>#initializer-block</string>
181
+ </dict>
178
182
  <dict>
179
183
  <key>include</key>
180
184
  <string>#punctuation-semicolon</string>
@@ -309,6 +313,10 @@
309
313
  <key>include</key>
310
314
  <string>#comment</string>
311
315
  </dict>
316
+ <dict>
317
+ <key>include</key>
318
+ <string>#dml-expression</string>
319
+ </dict>
312
320
  <dict>
313
321
  <key>include</key>
314
322
  <string>#merge-expression</string>
@@ -693,6 +701,32 @@
693
701
  </dict>
694
702
  </array>
695
703
  </dict>
704
+ <key>dml-expression</key>
705
+ <dict>
706
+ <key>begin</key>
707
+ <string>\b(delete|insert|undelete|update|upsert)\b\s+(?!new\b)</string>
708
+ <key>beginCaptures</key>
709
+ <dict>
710
+ <key>1</key>
711
+ <dict>
712
+ <key>name</key>
713
+ <string>support.function.apex</string>
714
+ </dict>
715
+ </dict>
716
+ <key>end</key>
717
+ <string>(?&lt;=\;)</string>
718
+ <key>patterns</key>
719
+ <array>
720
+ <dict>
721
+ <key>include</key>
722
+ <string>#expression</string>
723
+ </dict>
724
+ <dict>
725
+ <key>include</key>
726
+ <string>#punctuation-semicolon</string>
727
+ </dict>
728
+ </array>
729
+ </dict>
696
730
  <key>merge-expression</key>
697
731
  <dict>
698
732
  <key>begin</key>
@@ -1328,7 +1362,7 @@
1328
1362
  <key>extends-class</key>
1329
1363
  <dict>
1330
1364
  <key>begin</key>
1331
- <string>(extends)\b\s+([_[:alpha:]][_[:alnum:]]*)</string>
1365
+ <string>(extends)\b\s+</string>
1332
1366
  <key>beginCaptures</key>
1333
1367
  <dict>
1334
1368
  <key>1</key>
@@ -1336,14 +1370,41 @@
1336
1370
  <key>name</key>
1337
1371
  <string>keyword.other.extends.apex</string>
1338
1372
  </dict>
1339
- <key>2</key>
1340
- <dict>
1341
- <key>name</key>
1342
- <string>entity.name.type.extends.apex</string>
1343
- </dict>
1344
1373
  </dict>
1345
1374
  <key>end</key>
1346
1375
  <string>(?={|implements)</string>
1376
+ <key>patterns</key>
1377
+ <array>
1378
+ <dict>
1379
+ <key>begin</key>
1380
+ <string>(?=[_[:alpha:]][_[:alnum:]]*\s*\.)</string>
1381
+ <key>end</key>
1382
+ <string>(?={|implements)</string>
1383
+ <key>patterns</key>
1384
+ <array>
1385
+ <dict>
1386
+ <key>include</key>
1387
+ <string>#support-type</string>
1388
+ </dict>
1389
+ <dict>
1390
+ <key>include</key>
1391
+ <string>#type</string>
1392
+ </dict>
1393
+ </array>
1394
+ </dict>
1395
+ <dict>
1396
+ <key>match</key>
1397
+ <string>([_[:alpha:]][_[:alnum:]]*)</string>
1398
+ <key>captures</key>
1399
+ <dict>
1400
+ <key>1</key>
1401
+ <dict>
1402
+ <key>name</key>
1403
+ <string>entity.name.type.extends.apex</string>
1404
+ </dict>
1405
+ </dict>
1406
+ </dict>
1407
+ </array>
1347
1408
  </dict>
1348
1409
  <key>implements-class</key>
1349
1410
  <dict>
@@ -1359,6 +1420,23 @@
1359
1420
  </dict>
1360
1421
  <key>patterns</key>
1361
1422
  <array>
1423
+ <dict>
1424
+ <key>begin</key>
1425
+ <string>(?=[_[:alpha:]][_[:alnum:]]*\s*\.)</string>
1426
+ <key>end</key>
1427
+ <string>(?={|extends|,)</string>
1428
+ <key>patterns</key>
1429
+ <array>
1430
+ <dict>
1431
+ <key>include</key>
1432
+ <string>#support-type</string>
1433
+ </dict>
1434
+ <dict>
1435
+ <key>include</key>
1436
+ <string>#type</string>
1437
+ </dict>
1438
+ </array>
1439
+ </dict>
1362
1440
  <dict>
1363
1441
  <key>match</key>
1364
1442
  <string>([_[:alpha:]][_[:alnum:]]*)\b\s*(,)?</string>
@@ -1376,6 +1454,10 @@
1376
1454
  </dict>
1377
1455
  </dict>
1378
1456
  </dict>
1457
+ <dict>
1458
+ <key>include</key>
1459
+ <string>#punctuation-comma</string>
1460
+ </dict>
1379
1461
  </array>
1380
1462
  <key>end</key>
1381
1463
  <string>(?={|extends)</string>
@@ -2436,6 +2518,36 @@
2436
2518
  </dict>
2437
2519
  </array>
2438
2520
  </dict>
2521
+ <key>initializer-block</key>
2522
+ <dict>
2523
+ <key>begin</key>
2524
+ <string>\{</string>
2525
+ <key>beginCaptures</key>
2526
+ <dict>
2527
+ <key>0</key>
2528
+ <dict>
2529
+ <key>name</key>
2530
+ <string>punctuation.curlybrace.open.apex</string>
2531
+ </dict>
2532
+ </dict>
2533
+ <key>end</key>
2534
+ <string>\}</string>
2535
+ <key>endCaptures</key>
2536
+ <dict>
2537
+ <key>0</key>
2538
+ <dict>
2539
+ <key>name</key>
2540
+ <string>punctuation.curlybrace.close.apex</string>
2541
+ </dict>
2542
+ </dict>
2543
+ <key>patterns</key>
2544
+ <array>
2545
+ <dict>
2546
+ <key>include</key>
2547
+ <string>#statement</string>
2548
+ </dict>
2549
+ </array>
2550
+ </dict>
2439
2551
  <key>variable-initializer</key>
2440
2552
  <dict>
2441
2553
  <key>begin</key>
@@ -2761,7 +2873,7 @@
2761
2873
  <key>when-statement</key>
2762
2874
  <dict>
2763
2875
  <key>begin</key>
2764
- <string>(when)\b\s+([\'_\-[:alnum:]]+)\s*</string>
2876
+ <string>(when)\b\s+([_\-[:alnum:]]+)\s*</string>
2765
2877
  <key>beginCaptures</key>
2766
2878
  <dict>
2767
2879
  <key>1</key>
@@ -2781,7 +2893,7 @@
2781
2893
  </dict>
2782
2894
  </dict>
2783
2895
  <key>end</key>
2784
- <string>(?&lt;=\})</string>
2896
+ <string>(?=\})|(?=when\b)</string>
2785
2897
  <key>patterns</key>
2786
2898
  <array>
2787
2899
  <dict>
@@ -2797,7 +2909,7 @@
2797
2909
  <key>when-string</key>
2798
2910
  <dict>
2799
2911
  <key>begin</key>
2800
- <string>(when)\b\s*('[^'\n]*')(,)?</string>
2912
+ <string>(when)\b\s*('[^'\n]*')(\s*(,)\s*('[^'\n]*'))*\s*</string>
2801
2913
  <key>beginCaptures</key>
2802
2914
  <dict>
2803
2915
  <key>1</key>
@@ -2815,7 +2927,7 @@
2815
2927
  </dict>
2816
2928
  </array>
2817
2929
  </dict>
2818
- <key>3</key>
2930
+ <key>4</key>
2819
2931
  <dict>
2820
2932
  <key>patterns</key>
2821
2933
  <array>
@@ -2825,9 +2937,19 @@
2825
2937
  </dict>
2826
2938
  </array>
2827
2939
  </dict>
2940
+ <key>5</key>
2941
+ <dict>
2942
+ <key>patterns</key>
2943
+ <array>
2944
+ <dict>
2945
+ <key>include</key>
2946
+ <string>#string-literal</string>
2947
+ </dict>
2948
+ </array>
2949
+ </dict>
2828
2950
  </dict>
2829
2951
  <key>end</key>
2830
- <string>(?&lt;=\})</string>
2952
+ <string>(?=\})|(?=when\b)</string>
2831
2953
  <key>patterns</key>
2832
2954
  <array>
2833
2955
  <dict>
@@ -2858,7 +2980,7 @@
2858
2980
  </dict>
2859
2981
  </dict>
2860
2982
  <key>end</key>
2861
- <string>(?&lt;=\})</string>
2983
+ <string>(?=\})|(?=when\b)</string>
2862
2984
  <key>patterns</key>
2863
2985
  <array>
2864
2986
  <dict>
@@ -2884,7 +3006,7 @@
2884
3006
  </dict>
2885
3007
  </dict>
2886
3008
  <key>end</key>
2887
- <string>(?&lt;=\})</string>
3009
+ <string>(?=\})|(?=when\b)</string>
2888
3010
  <key>patterns</key>
2889
3011
  <array>
2890
3012
  <dict>
@@ -2895,6 +3017,10 @@
2895
3017
  <key>include</key>
2896
3018
  <string>#expression</string>
2897
3019
  </dict>
3020
+ <dict>
3021
+ <key>include</key>
3022
+ <string>#punctuation-comma</string>
3023
+ </dict>
2898
3024
  </array>
2899
3025
  </dict>
2900
3026
  <key>when-sobject-statement</key>
@@ -2920,7 +3046,7 @@
2920
3046
  </dict>
2921
3047
  </dict>
2922
3048
  <key>end</key>
2923
- <string>(?&lt;=\})</string>
3049
+ <string>(?=\})|(?=when\b)</string>
2924
3050
  <key>patterns</key>
2925
3051
  <array>
2926
3052
  <dict>
@@ -3672,7 +3798,7 @@
3672
3798
  <key>conditional-operator</key>
3673
3799
  <dict>
3674
3800
  <key>begin</key>
3675
- <string>(?&lt;!\?)\?(?!\?|\.|\[)</string>
3801
+ <string>(?&lt;!\?)\?(?!\?|\.(?!\d)|\[)</string>
3676
3802
  <key>beginCaptures</key>
3677
3803
  <dict>
3678
3804
  <key>0</key>
@@ -4251,7 +4377,7 @@
4251
4377
  <dict>
4252
4378
  <key>match</key>
4253
4379
  <string>(?x)
4254
- (?:(?:\b(this)\b)\s+)?
4380
+ (?:(?:\b(this|final)\b)\s+)?
4255
4381
  (?&lt;type_name&gt;
4256
4382
  (?:
4257
4383
  (?:ref\s+)? # ref return
@@ -4438,7 +4564,7 @@
4438
4564
  <key>type-builtin</key>
4439
4565
  <dict>
4440
4566
  <key>match</key>
4441
- <string>\b(Blob|Boolean|byte|Date|Datetime|Decimal|Double|ID|Integer|Long|Object|String|Time|void)\b</string>
4567
+ <string>\b(Blob|Boolean|byte|Date|Datetime|Decimal|Double|Id|ID|Integer|Long|Object|String|Time|void)\b</string>
4442
4568
  <key>captures</key>
4443
4569
  <dict>
4444
4570
  <key>1</key>
@@ -119,6 +119,9 @@ repository:
119
119
  {
120
120
  include: '#method-declaration'
121
121
  }
122
+ {
123
+ include: '#initializer-block'
124
+ }
122
125
  {
123
126
  include: '#punctuation-semicolon'
124
127
  }
@@ -215,6 +218,9 @@ repository:
215
218
  {
216
219
  include: '#comment'
217
220
  }
221
+ {
222
+ include: '#dml-expression'
223
+ }
218
224
  {
219
225
  include: '#merge-expression'
220
226
  }
@@ -433,6 +439,20 @@ repository:
433
439
  include: '#punctuation-comma'
434
440
  }
435
441
  ]
442
+ 'dml-expression':
443
+ begin: '\\b(delete|insert|undelete|update|upsert)\\b\\s+(?!new\\b)'
444
+ beginCaptures:
445
+ '1':
446
+ name: 'support.function.apex'
447
+ end: '(?<=\\;)'
448
+ patterns: [
449
+ {
450
+ include: '#expression'
451
+ }
452
+ {
453
+ include: '#punctuation-semicolon'
454
+ }
455
+ ]
436
456
  'merge-expression':
437
457
  begin: '(merge)\\b\\s+'
438
458
  beginCaptures:
@@ -797,19 +817,49 @@ repository:
797
817
  }
798
818
  ]
799
819
  'extends-class':
800
- begin: '(extends)\\b\\s+([_[:alpha:]][_[:alnum:]]*)'
820
+ begin: '(extends)\\b\\s+'
801
821
  beginCaptures:
802
822
  '1':
803
823
  name: 'keyword.other.extends.apex'
804
- '2':
805
- name: 'entity.name.type.extends.apex'
806
824
  end: '(?={|implements)'
825
+ patterns: [
826
+ {
827
+ begin: '(?=[_[:alpha:]][_[:alnum:]]*\\s*\\.)'
828
+ end: '(?={|implements)'
829
+ patterns: [
830
+ {
831
+ include: '#support-type'
832
+ }
833
+ {
834
+ include: '#type'
835
+ }
836
+ ]
837
+ }
838
+ {
839
+ match: '([_[:alpha:]][_[:alnum:]]*)'
840
+ captures:
841
+ '1':
842
+ name: 'entity.name.type.extends.apex'
843
+ }
844
+ ]
807
845
  'implements-class':
808
846
  begin: '(implements)\\b'
809
847
  beginCaptures:
810
848
  '1':
811
849
  name: 'keyword.other.implements.apex'
812
850
  patterns: [
851
+ {
852
+ begin: '(?=[_[:alpha:]][_[:alnum:]]*\\s*\\.)'
853
+ end: '(?={|extends|,)'
854
+ patterns: [
855
+ {
856
+ include: '#support-type'
857
+ }
858
+ {
859
+ include: '#type'
860
+ }
861
+ ]
862
+ }
813
863
  {
814
864
  match: '([_[:alpha:]][_[:alnum:]]*)\\b\\s*(,)?'
815
865
  captures:
@@ -818,6 +868,9 @@ repository:
818
868
  '2':
819
869
  name: 'punctuation.separator.comma.apex'
820
870
  }
871
+ {
872
+ include: '#punctuation-comma'
873
+ }
821
874
  ]
822
875
  end: '(?={|extends)'
823
876
  'soql-query-expression':
@@ -1454,6 +1507,20 @@ repository:
1454
1507
  include: '#statement'
1455
1508
  }
1456
1509
  ]
1510
+ 'initializer-block':
1511
+ begin: '\\{'
1512
+ beginCaptures:
1513
+ '0':
1514
+ name: 'punctuation.curlybrace.open.apex'
1515
+ end: '\\}'
1516
+ endCaptures:
1517
+ '0':
1518
+ name: 'punctuation.curlybrace.close.apex'
1519
+ patterns: [
1520
+ {
1521
+ include: '#statement'
1522
+ }
1523
+ ]
1457
1524
  'variable-initializer':
1458
1525
  begin: '(?<!=|!)(=)(?!=|>)'
1459
1526
  beginCaptures:
@@ -1627,7 +1694,7 @@ repository:
1627
1694
  }
1628
1695
  ]
1629
1696
  'when-statement':
1630
- begin: "(when)\\b\\s+([\\'_\\-[:alnum:]]+)\\s*"
1697
+ begin: '(when)\\b\\s+([_\\-[:alnum:]]+)\\s*'
1631
1698
  beginCaptures:
1632
1699
  '1':
1633
1700
  name: 'keyword.control.switch.when.apex'
@@ -1637,7 +1704,7 @@ repository:
1637
1704
  include: '#expression'
1638
1705
  }
1639
1706
  ]
1640
- end: '(?<=\\})'
1707
+ end: '(?=\\})|(?=when\\b)'
1641
1708
  patterns: [
1642
1709
  {
1643
1710
  include: '#block'
@@ -1647,7 +1714,7 @@ repository:
1647
1714
  }
1648
1715
  ]
1649
1716
  'when-string':
1650
- begin: "(when)\\b\\s*('[^'\\n]*')(,)?"
1717
+ begin: "(when)\\b\\s*('[^'\\n]*')(\\s*(,)\\s*('[^'\\n]*'))*\\s*"
1651
1718
  beginCaptures:
1652
1719
  '1':
1653
1720
  name: 'keyword.control.switch.when.apex'
@@ -1657,13 +1724,19 @@ repository:
1657
1724
  include: '#string-literal'
1658
1725
  }
1659
1726
  ]
1660
- '3':
1727
+ '4':
1661
1728
  patterns: [
1662
1729
  {
1663
1730
  include: '#punctuation-comma'
1664
1731
  }
1665
1732
  ]
1666
- end: '(?<=\\})'
1733
+ '5':
1734
+ patterns: [
1735
+ {
1736
+ include: '#string-literal'
1737
+ }
1738
+ ]
1739
+ end: '(?=\\})|(?=when\\b)'
1667
1740
  patterns: [
1668
1741
  {
1669
1742
  include: '#block'
@@ -1679,7 +1752,7 @@ repository:
1679
1752
  name: 'keyword.control.switch.when.apex'
1680
1753
  '2':
1681
1754
  name: 'keyword.control.switch.else.apex'
1682
- end: '(?<=\\})'
1755
+ end: '(?=\\})|(?=when\\b)'
1683
1756
  patterns: [
1684
1757
  {
1685
1758
  include: '#block'
@@ -1693,7 +1766,7 @@ repository:
1693
1766
  beginCaptures:
1694
1767
  '1':
1695
1768
  name: 'keyword.control.switch.when.apex'
1696
- end: '(?<=\\})'
1769
+ end: '(?=\\})|(?=when\\b)'
1697
1770
  patterns: [
1698
1771
  {
1699
1772
  include: '#block'
@@ -1701,6 +1774,9 @@ repository:
1701
1774
  {
1702
1775
  include: '#expression'
1703
1776
  }
1777
+ {
1778
+ include: '#punctuation-comma'
1779
+ }
1704
1780
  ]
1705
1781
  'when-sobject-statement':
1706
1782
  begin: '(when)\\b\\s+([_[:alnum:]]+)\\s+([_[:alnum:]]+)\\s*'
@@ -1711,7 +1787,7 @@ repository:
1711
1787
  name: 'storage.type.apex'
1712
1788
  '3':
1713
1789
  name: 'entity.name.variable.local.apex'
1714
- end: '(?<=\\})'
1790
+ end: '(?=\\})|(?=when\\b)'
1715
1791
  patterns: [
1716
1792
  {
1717
1793
  include: '#block'
@@ -2166,7 +2242,7 @@ repository:
2166
2242
  }
2167
2243
  ]
2168
2244
  'conditional-operator':
2169
- begin: '(?<!\\?)\\?(?!\\?|\\.|\\[)'
2245
+ begin: '(?<!\\?)\\?(?!\\?|\\.(?!\\d)|\\[)'
2170
2246
  beginCaptures:
2171
2247
  '0':
2172
2248
  name: 'keyword.operator.conditional.question-mark.apex'
@@ -2533,7 +2609,7 @@ repository:
2533
2609
  parameter:
2534
2610
  match: '''
2535
2611
  (?x)
2536
- (?:(?:\\b(this)\\b)\\s+)?
2612
+ (?:(?:\\b(this|final)\\b)\\s+)?
2537
2613
  (?<type_name>
2538
2614
  (?:
2539
2615
  (?:ref\\s+)? # ref return
@@ -2644,7 +2720,7 @@ repository:
2644
2720
  }
2645
2721
  ]
2646
2722
  'type-builtin':
2647
- match: '\\b(Blob|Boolean|byte|Date|Datetime|Decimal|Double|ID|Integer|Long|Object|String|Time|void)\\b'
2723
+ match: '\\b(Blob|Boolean|byte|Date|Datetime|Decimal|Double|Id|ID|Integer|Long|Object|String|Time|void)\\b'
2648
2724
  captures:
2649
2725
  '1':
2650
2726
  name: 'keyword.type.apex'
@@ -161,6 +161,10 @@
161
161
  <key>include</key>
162
162
  <string>#method-declaration</string>
163
163
  </dict>
164
+ <dict>
165
+ <key>include</key>
166
+ <string>#initializer-block</string>
167
+ </dict>
164
168
  <dict>
165
169
  <key>include</key>
166
170
  <string>#punctuation-semicolon</string>
@@ -295,6 +299,10 @@
295
299
  <key>include</key>
296
300
  <string>#comment</string>
297
301
  </dict>
302
+ <dict>
303
+ <key>include</key>
304
+ <string>#dml-expression</string>
305
+ </dict>
298
306
  <dict>
299
307
  <key>include</key>
300
308
  <string>#merge-expression</string>
@@ -679,6 +687,32 @@
679
687
  </dict>
680
688
  </array>
681
689
  </dict>
690
+ <key>dml-expression</key>
691
+ <dict>
692
+ <key>begin</key>
693
+ <string>\b(delete|insert|undelete|update|upsert)\b\s+(?!new\b)</string>
694
+ <key>beginCaptures</key>
695
+ <dict>
696
+ <key>1</key>
697
+ <dict>
698
+ <key>name</key>
699
+ <string>support.function.apex</string>
700
+ </dict>
701
+ </dict>
702
+ <key>end</key>
703
+ <string>(?&lt;=\;)</string>
704
+ <key>patterns</key>
705
+ <array>
706
+ <dict>
707
+ <key>include</key>
708
+ <string>#expression</string>
709
+ </dict>
710
+ <dict>
711
+ <key>include</key>
712
+ <string>#punctuation-semicolon</string>
713
+ </dict>
714
+ </array>
715
+ </dict>
682
716
  <key>merge-expression</key>
683
717
  <dict>
684
718
  <key>begin</key>
@@ -1314,7 +1348,7 @@
1314
1348
  <key>extends-class</key>
1315
1349
  <dict>
1316
1350
  <key>begin</key>
1317
- <string>(extends)\b\s+([_[:alpha:]][_[:alnum:]]*)</string>
1351
+ <string>(extends)\b\s+</string>
1318
1352
  <key>beginCaptures</key>
1319
1353
  <dict>
1320
1354
  <key>1</key>
@@ -1322,14 +1356,41 @@
1322
1356
  <key>name</key>
1323
1357
  <string>keyword.other.extends.apex</string>
1324
1358
  </dict>
1325
- <key>2</key>
1326
- <dict>
1327
- <key>name</key>
1328
- <string>entity.name.type.extends.apex</string>
1329
- </dict>
1330
1359
  </dict>
1331
1360
  <key>end</key>
1332
1361
  <string>(?={|implements)</string>
1362
+ <key>patterns</key>
1363
+ <array>
1364
+ <dict>
1365
+ <key>begin</key>
1366
+ <string>(?=[_[:alpha:]][_[:alnum:]]*\s*\.)</string>
1367
+ <key>end</key>
1368
+ <string>(?={|implements)</string>
1369
+ <key>patterns</key>
1370
+ <array>
1371
+ <dict>
1372
+ <key>include</key>
1373
+ <string>#support-type</string>
1374
+ </dict>
1375
+ <dict>
1376
+ <key>include</key>
1377
+ <string>#type</string>
1378
+ </dict>
1379
+ </array>
1380
+ </dict>
1381
+ <dict>
1382
+ <key>match</key>
1383
+ <string>([_[:alpha:]][_[:alnum:]]*)</string>
1384
+ <key>captures</key>
1385
+ <dict>
1386
+ <key>1</key>
1387
+ <dict>
1388
+ <key>name</key>
1389
+ <string>entity.name.type.extends.apex</string>
1390
+ </dict>
1391
+ </dict>
1392
+ </dict>
1393
+ </array>
1333
1394
  </dict>
1334
1395
  <key>implements-class</key>
1335
1396
  <dict>
@@ -1345,6 +1406,23 @@
1345
1406
  </dict>
1346
1407
  <key>patterns</key>
1347
1408
  <array>
1409
+ <dict>
1410
+ <key>begin</key>
1411
+ <string>(?=[_[:alpha:]][_[:alnum:]]*\s*\.)</string>
1412
+ <key>end</key>
1413
+ <string>(?={|extends|,)</string>
1414
+ <key>patterns</key>
1415
+ <array>
1416
+ <dict>
1417
+ <key>include</key>
1418
+ <string>#support-type</string>
1419
+ </dict>
1420
+ <dict>
1421
+ <key>include</key>
1422
+ <string>#type</string>
1423
+ </dict>
1424
+ </array>
1425
+ </dict>
1348
1426
  <dict>
1349
1427
  <key>match</key>
1350
1428
  <string>([_[:alpha:]][_[:alnum:]]*)\b\s*(,)?</string>
@@ -1362,6 +1440,10 @@
1362
1440
  </dict>
1363
1441
  </dict>
1364
1442
  </dict>
1443
+ <dict>
1444
+ <key>include</key>
1445
+ <string>#punctuation-comma</string>
1446
+ </dict>
1365
1447
  </array>
1366
1448
  <key>end</key>
1367
1449
  <string>(?={|extends)</string>
@@ -2418,6 +2500,36 @@
2418
2500
  </dict>
2419
2501
  </array>
2420
2502
  </dict>
2503
+ <key>initializer-block</key>
2504
+ <dict>
2505
+ <key>begin</key>
2506
+ <string>\{</string>
2507
+ <key>beginCaptures</key>
2508
+ <dict>
2509
+ <key>0</key>
2510
+ <dict>
2511
+ <key>name</key>
2512
+ <string>punctuation.curlybrace.open.apex</string>
2513
+ </dict>
2514
+ </dict>
2515
+ <key>end</key>
2516
+ <string>\}</string>
2517
+ <key>endCaptures</key>
2518
+ <dict>
2519
+ <key>0</key>
2520
+ <dict>
2521
+ <key>name</key>
2522
+ <string>punctuation.curlybrace.close.apex</string>
2523
+ </dict>
2524
+ </dict>
2525
+ <key>patterns</key>
2526
+ <array>
2527
+ <dict>
2528
+ <key>include</key>
2529
+ <string>#statement</string>
2530
+ </dict>
2531
+ </array>
2532
+ </dict>
2421
2533
  <key>variable-initializer</key>
2422
2534
  <dict>
2423
2535
  <key>begin</key>
@@ -2743,7 +2855,7 @@
2743
2855
  <key>when-statement</key>
2744
2856
  <dict>
2745
2857
  <key>begin</key>
2746
- <string>(when)\b\s+([\'_\-[:alnum:]]+)\s*</string>
2858
+ <string>(when)\b\s+([_\-[:alnum:]]+)\s*</string>
2747
2859
  <key>beginCaptures</key>
2748
2860
  <dict>
2749
2861
  <key>1</key>
@@ -2763,7 +2875,7 @@
2763
2875
  </dict>
2764
2876
  </dict>
2765
2877
  <key>end</key>
2766
- <string>(?&lt;=\})</string>
2878
+ <string>(?=\})|(?=when\b)</string>
2767
2879
  <key>patterns</key>
2768
2880
  <array>
2769
2881
  <dict>
@@ -2779,7 +2891,7 @@
2779
2891
  <key>when-string</key>
2780
2892
  <dict>
2781
2893
  <key>begin</key>
2782
- <string>(when)\b\s*('[^'\n]*')(,)?</string>
2894
+ <string>(when)\b\s*('[^'\n]*')(\s*(,)\s*('[^'\n]*'))*\s*</string>
2783
2895
  <key>beginCaptures</key>
2784
2896
  <dict>
2785
2897
  <key>1</key>
@@ -2797,7 +2909,7 @@
2797
2909
  </dict>
2798
2910
  </array>
2799
2911
  </dict>
2800
- <key>3</key>
2912
+ <key>4</key>
2801
2913
  <dict>
2802
2914
  <key>patterns</key>
2803
2915
  <array>
@@ -2807,9 +2919,19 @@
2807
2919
  </dict>
2808
2920
  </array>
2809
2921
  </dict>
2922
+ <key>5</key>
2923
+ <dict>
2924
+ <key>patterns</key>
2925
+ <array>
2926
+ <dict>
2927
+ <key>include</key>
2928
+ <string>#string-literal</string>
2929
+ </dict>
2930
+ </array>
2931
+ </dict>
2810
2932
  </dict>
2811
2933
  <key>end</key>
2812
- <string>(?&lt;=\})</string>
2934
+ <string>(?=\})|(?=when\b)</string>
2813
2935
  <key>patterns</key>
2814
2936
  <array>
2815
2937
  <dict>
@@ -2840,7 +2962,7 @@
2840
2962
  </dict>
2841
2963
  </dict>
2842
2964
  <key>end</key>
2843
- <string>(?&lt;=\})</string>
2965
+ <string>(?=\})|(?=when\b)</string>
2844
2966
  <key>patterns</key>
2845
2967
  <array>
2846
2968
  <dict>
@@ -2866,7 +2988,7 @@
2866
2988
  </dict>
2867
2989
  </dict>
2868
2990
  <key>end</key>
2869
- <string>(?&lt;=\})</string>
2991
+ <string>(?=\})|(?=when\b)</string>
2870
2992
  <key>patterns</key>
2871
2993
  <array>
2872
2994
  <dict>
@@ -2877,6 +2999,10 @@
2877
2999
  <key>include</key>
2878
3000
  <string>#expression</string>
2879
3001
  </dict>
3002
+ <dict>
3003
+ <key>include</key>
3004
+ <string>#punctuation-comma</string>
3005
+ </dict>
2880
3006
  </array>
2881
3007
  </dict>
2882
3008
  <key>when-sobject-statement</key>
@@ -2902,7 +3028,7 @@
2902
3028
  </dict>
2903
3029
  </dict>
2904
3030
  <key>end</key>
2905
- <string>(?&lt;=\})</string>
3031
+ <string>(?=\})|(?=when\b)</string>
2906
3032
  <key>patterns</key>
2907
3033
  <array>
2908
3034
  <dict>
@@ -3654,7 +3780,7 @@
3654
3780
  <key>conditional-operator</key>
3655
3781
  <dict>
3656
3782
  <key>begin</key>
3657
- <string>(?&lt;!\?)\?(?!\?|\.|\[)</string>
3783
+ <string>(?&lt;!\?)\?(?!\?|\.(?!\d)|\[)</string>
3658
3784
  <key>beginCaptures</key>
3659
3785
  <dict>
3660
3786
  <key>0</key>
@@ -4233,7 +4359,7 @@
4233
4359
  <dict>
4234
4360
  <key>match</key>
4235
4361
  <string>(?x)
4236
- (?:(?:\b(this)\b)\s+)?
4362
+ (?:(?:\b(this|final)\b)\s+)?
4237
4363
  (?&lt;type_name&gt;
4238
4364
  (?:
4239
4365
  (?:ref\s+)? # ref return
@@ -4420,7 +4546,7 @@
4420
4546
  <key>type-builtin</key>
4421
4547
  <dict>
4422
4548
  <key>match</key>
4423
- <string>\b(Blob|Boolean|byte|Date|Datetime|Decimal|Double|ID|Integer|Long|Object|String|Time|void)\b</string>
4549
+ <string>\b(Blob|Boolean|byte|Date|Datetime|Decimal|Double|Id|ID|Integer|Long|Object|String|Time|void)\b</string>
4424
4550
  <key>captures</key>
4425
4551
  <dict>
4426
4552
  <key>1</key>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/apex-tmlanguage",
3
- "version": "1.8.2",
3
+ "version": "2.0.1",
4
4
  "description": "Textmate grammar for Apex with outputs for VSCode, Atom and TextMate.",
5
5
  "displayName": "apex-tmLanguage",
6
6
  "keywords": [
@@ -36,8 +36,6 @@
36
36
  "build:soql": "node scripts/build-soql.js",
37
37
  "build": "npm run build:grammars && npm run build:atom && npm run build:soql",
38
38
  "compile": "tsc -p .",
39
- "commit-init": "commitizen init cz-conventional-changelog --save-dev --save-exact --force",
40
- "commit": "git-cz",
41
39
  "watch": "tsc -w -p .",
42
40
  "test:soql-tmgrammar": "vscode-tmgrammar-test -g \"./grammars/soql.tmLanguage\" \"./test/soql/*.soql\" ",
43
41
  "test:soql-tmgrammar-snapshots": "vscode-tmgrammar-snap -s source.soql -g \"./grammars/soql.tmLanguage\" \"./test/soql/snapshots/*.soql\" ",
@@ -51,33 +49,27 @@
51
49
  "README.md"
52
50
  ],
53
51
  "engines": {
54
- "node": ">=16"
52
+ "node": ">=20"
55
53
  },
56
54
  "devDependencies": {
57
- "@commitlint/cli": "^17",
58
- "@commitlint/config-conventional": "^17",
55
+ "@commitlint/cli": "^20",
56
+ "@commitlint/config-conventional": "^20",
59
57
  "@types/chai": "4.3.4",
60
58
  "@types/mocha": "^10.0.10",
61
59
  "chai": "^4.3.7",
62
- "commitizen": "^4.3.1",
63
60
  "cson-parser": "^4.0.9",
64
61
  "cz-conventional-changelog": "^3.3.0",
65
- "js-yaml": "^4.1.0",
66
- "mocha": "^10.1.0",
62
+ "js-yaml": "^4.1.1",
63
+ "mocha": "^11.7.5",
67
64
  "plist": "^3.1.0",
68
- "prettier": "^2.8.0",
65
+ "prettier": "^3.6.2",
69
66
  "typescript": "4.9.3",
70
- "vscode-textmate": "^9.2.0",
67
+ "vscode-textmate": "^9.2.1",
71
68
  "vscode-tmgrammar-test": "^0.1.3"
72
69
  },
73
70
  "husky": {
74
71
  "hooks": {
75
72
  "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
76
73
  }
77
- },
78
- "config": {
79
- "commitizen": {
80
- "path": "./node_modules/cz-conventional-changelog"
81
- }
82
74
  }
83
75
  }