Commit 5efbd5a
authored
* test: add test for annotation on same line as method (issue #44)
- Add test case for annotation on same line as method declaration
- Test verifies correct highlighting in this scenario
- Test currently passes, indicating issue may already be resolved
Closes #44
* test: add tests for ternary expressions (issue #43)
- Add test cases for nested ternary expressions
- Add test case for ternary with method calls
- Tests verify correct highlighting in these scenarios
- Tests currently pass, indicating issue may already be resolved
Closes #43
* fix: DML operations on method call results (issue #26)
- Add dml-expression pattern to handle DML operations on expressions
- Pattern matches insert/update/delete/upsert/undelete followed by expressions
- Ensures DML operations receive same scope (support.function.apex) whether
applied to new objects or method call results like Map.values()
- Add test case verifying insert accounts.values() gets same scope as insert new List
Closes #26
* fix: support namespace-qualified types in extends/implements (issue #50)
- Update extends-class pattern to handle namespace-qualified types
- Update implements-class pattern to handle namespace-qualified types
- Patterns now correctly tokenize System.Exception, Database.Batchable, etc.
- Use lookahead to distinguish namespace-qualified from simple types
- Fix type-builtin to use 'Id' instead of 'ID' to match Apex convention
- Add test cases for namespace-qualified extends and implements
Closes #50
* fix: support namespace-qualified types in extends/implements (issue #50)
- Update extends-class pattern to handle namespace-qualified types
- Update implements-class pattern to handle namespace-qualified types
- Patterns now correctly tokenize System.Exception, Database.Batchable, etc.
- Use lookahead to distinguish namespace-qualified from simple types
- Fix type-builtin to support both 'Id' and 'ID' (Apex is case-insensitive)
- Add test cases for namespace-qualified extends and implements
Closes #50
* test: add coverage for both Id and ID (case-insensitive Apex)
- Add test for Id (lowercase d) as field type
- Add test for ID (uppercase D) as field type
- Add test for Id in generic type parameters
- Add test for ID in generic type parameters
- Verifies Apex case-insensitive support for Id/ID primitive type
* feat: support for varied casing on ID/Id
* fix: Add syntax highlighting for initialization blocks
Add initializer-block pattern to grammar to properly highlight code
inside initialization blocks (standalone { } blocks at class member level).
The pattern matches standalone curly brace blocks and includes statement
patterns for proper syntax highlighting, matching method body behavior.
Fixes: forcedotcom/salesforcedx-vscode#4920
* test: Add tests for initialization block syntax highlighting
Add comprehensive tests to verify initialization blocks are properly
highlighted, including:
- Empty initialization blocks
- Method calls with string literals (the main issue #4920)
- Multiple statements
- Nested class scenario
- Comparison with method body highlighting
* test: Add test for static keyword before block
Even though Apex doesn't support static initialization blocks,
verify the grammar handles the syntax for highlighting purposes.
* fix: Fix switch/when statement syntax highlighting and brace matching
- Remove lookbehind end patterns from all when-* statements that prevented proper brace matching
- Update end patterns to use lookahead that ends on closing brace or next when clause
- Improve when-string pattern to support multiple comma-separated strings
- Fix issue #2134: syntax highlighting and brace matching for switch/when statements
All switch statement tests passing.
* fix: Fix dash highlighting in switch statement string literals
- Remove quote character from when-statement pattern character class
- Change from ['_\-[:alnum:]]+ to [_\-[:alnum:]]+
- Ensures string literals with dashes like 'de-CH' and 'fr-CH' are matched by when-string pattern
- Add test case for string literals containing dashes in switch statements
This fixes an issue where the when-statement pattern would incorrectly match
string literals containing dashes, preventing proper syntax highlighting.
* fix: support namespace-qualified types in extends/implements (#50) (#72)
* fix: support namespace-qualified types in extends/implements (issue #50)
- Update extends-class pattern to handle namespace-qualified types
- Update implements-class pattern to handle namespace-qualified types
- Patterns now correctly tokenize System.Exception, Database.Batchable, etc.
- Use lookahead to distinguish namespace-qualified from simple types
- Fix type-builtin to support both 'Id' and 'ID' (Apex is case-insensitive)
- Add test cases for namespace-qualified extends and implements
Closes #50
* test: add coverage for both Id and ID (case-insensitive Apex)
- Add test for Id (lowercase d) as field type
- Add test for ID (uppercase D) as field type
- Add test for Id in generic type parameters
- Add test for ID in generic type parameters
- Verifies Apex case-insensitive support for Id/ID primitive type
* feat: support for varied casing on ID/Id
* chore: pr reproducers in sfdx project for visual inspection
* fix: 4920 initializer block syntax W-19265631 (#73)
* fix: support namespace-qualified types in extends/implements (issue #50)
- Update extends-class pattern to handle namespace-qualified types
- Update implements-class pattern to handle namespace-qualified types
- Patterns now correctly tokenize System.Exception, Database.Batchable, etc.
- Use lookahead to distinguish namespace-qualified from simple types
- Fix type-builtin to support both 'Id' and 'ID' (Apex is case-insensitive)
- Add test cases for namespace-qualified extends and implements
Closes #50
* test: add coverage for both Id and ID (case-insensitive Apex)
- Add test for Id (lowercase d) as field type
- Add test for ID (uppercase D) as field type
- Add test for Id in generic type parameters
- Add test for ID in generic type parameters
- Verifies Apex case-insensitive support for Id/ID primitive type
* feat: support for varied casing on ID/Id
* fix: Add syntax highlighting for initialization blocks
Add initializer-block pattern to grammar to properly highlight code
inside initialization blocks (standalone { } blocks at class member level).
The pattern matches standalone curly brace blocks and includes statement
patterns for proper syntax highlighting, matching method body behavior.
Fixes: forcedotcom/salesforcedx-vscode#4920
* test: Add tests for initialization block syntax highlighting
Add comprehensive tests to verify initialization blocks are properly
highlighted, including:
- Empty initialization blocks
- Method calls with string literals (the main issue #4920)
- Multiple statements
- Nested class scenario
- Comparison with method body highlighting
* test: Add test for static keyword before block
Even though Apex doesn't support static initialization blocks,
verify the grammar handles the syntax for highlighting purposes.
* fix: Fix switch/when statement syntax highlighting and brace matching (issue #2134) (#74)
* fix: support namespace-qualified types in extends/implements (issue #50)
- Update extends-class pattern to handle namespace-qualified types
- Update implements-class pattern to handle namespace-qualified types
- Patterns now correctly tokenize System.Exception, Database.Batchable, etc.
- Use lookahead to distinguish namespace-qualified from simple types
- Fix type-builtin to support both 'Id' and 'ID' (Apex is case-insensitive)
- Add test cases for namespace-qualified extends and implements
Closes #50
* test: add coverage for both Id and ID (case-insensitive Apex)
- Add test for Id (lowercase d) as field type
- Add test for ID (uppercase D) as field type
- Add test for Id in generic type parameters
- Add test for ID in generic type parameters
- Verifies Apex case-insensitive support for Id/ID primitive type
* feat: support for varied casing on ID/Id
* fix: Add syntax highlighting for initialization blocks
Add initializer-block pattern to grammar to properly highlight code
inside initialization blocks (standalone { } blocks at class member level).
The pattern matches standalone curly brace blocks and includes statement
patterns for proper syntax highlighting, matching method body behavior.
Fixes: forcedotcom/salesforcedx-vscode#4920
* test: Add tests for initialization block syntax highlighting
Add comprehensive tests to verify initialization blocks are properly
highlighted, including:
- Empty initialization blocks
- Method calls with string literals (the main issue #4920)
- Multiple statements
- Nested class scenario
- Comparison with method body highlighting
* test: Add test for static keyword before block
Even though Apex doesn't support static initialization blocks,
verify the grammar handles the syntax for highlighting purposes.
* fix: Fix switch/when statement syntax highlighting and brace matching
- Remove lookbehind end patterns from all when-* statements that prevented proper brace matching
- Update end patterns to use lookahead that ends on closing brace or next when clause
- Improve when-string pattern to support multiple comma-separated strings
- Fix issue #2134: syntax highlighting and brace matching for switch/when statements
All switch statement tests passing.
* fix: Fix dash highlighting in switch statement string literals
- Remove quote character from when-statement pattern character class
- Change from ['_\-[:alnum:]]+ to [_\-[:alnum:]]+
- Ensures string literals with dashes like 'de-CH' and 'fr-CH' are matched by when-string pattern
- Add test case for string literals containing dashes in switch statements
This fixes an issue where the when-statement pattern would incorrectly match
string literals containing dashes, preventing proper syntax highlighting.
1 parent b6b7737 commit 5efbd5a
File tree
31 files changed
+1334
-61
lines changed- grammars
- src
- test
- repros
- .vscode
- force-app/main/default/classes
- utils
31 files changed
+1334
-61
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
178 | 182 | | |
179 | 183 | | |
180 | 184 | | |
| |||
309 | 313 | | |
310 | 314 | | |
311 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
312 | 320 | | |
313 | 321 | | |
314 | 322 | | |
| |||
693 | 701 | | |
694 | 702 | | |
695 | 703 | | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
696 | 730 | | |
697 | 731 | | |
698 | 732 | | |
| |||
1328 | 1362 | | |
1329 | 1363 | | |
1330 | 1364 | | |
1331 | | - | |
| 1365 | + | |
1332 | 1366 | | |
1333 | 1367 | | |
1334 | 1368 | | |
1335 | 1369 | | |
1336 | 1370 | | |
1337 | 1371 | | |
1338 | 1372 | | |
1339 | | - | |
1340 | | - | |
1341 | | - | |
1342 | | - | |
1343 | | - | |
1344 | 1373 | | |
1345 | 1374 | | |
1346 | 1375 | | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
1347 | 1408 | | |
1348 | 1409 | | |
1349 | 1410 | | |
| |||
1359 | 1420 | | |
1360 | 1421 | | |
1361 | 1422 | | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
1362 | 1440 | | |
1363 | 1441 | | |
1364 | 1442 | | |
| |||
1376 | 1454 | | |
1377 | 1455 | | |
1378 | 1456 | | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
1379 | 1461 | | |
1380 | 1462 | | |
1381 | 1463 | | |
| |||
2436 | 2518 | | |
2437 | 2519 | | |
2438 | 2520 | | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
2439 | 2551 | | |
2440 | 2552 | | |
2441 | 2553 | | |
| |||
2761 | 2873 | | |
2762 | 2874 | | |
2763 | 2875 | | |
2764 | | - | |
| 2876 | + | |
2765 | 2877 | | |
2766 | 2878 | | |
2767 | 2879 | | |
| |||
2781 | 2893 | | |
2782 | 2894 | | |
2783 | 2895 | | |
2784 | | - | |
| 2896 | + | |
2785 | 2897 | | |
2786 | 2898 | | |
2787 | 2899 | | |
| |||
2797 | 2909 | | |
2798 | 2910 | | |
2799 | 2911 | | |
2800 | | - | |
| 2912 | + | |
2801 | 2913 | | |
2802 | 2914 | | |
2803 | 2915 | | |
| |||
2815 | 2927 | | |
2816 | 2928 | | |
2817 | 2929 | | |
2818 | | - | |
| 2930 | + | |
2819 | 2931 | | |
2820 | 2932 | | |
2821 | 2933 | | |
| |||
2825 | 2937 | | |
2826 | 2938 | | |
2827 | 2939 | | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
2828 | 2950 | | |
2829 | 2951 | | |
2830 | | - | |
| 2952 | + | |
2831 | 2953 | | |
2832 | 2954 | | |
2833 | 2955 | | |
| |||
2858 | 2980 | | |
2859 | 2981 | | |
2860 | 2982 | | |
2861 | | - | |
| 2983 | + | |
2862 | 2984 | | |
2863 | 2985 | | |
2864 | 2986 | | |
| |||
2884 | 3006 | | |
2885 | 3007 | | |
2886 | 3008 | | |
2887 | | - | |
| 3009 | + | |
2888 | 3010 | | |
2889 | 3011 | | |
2890 | 3012 | | |
| |||
2895 | 3017 | | |
2896 | 3018 | | |
2897 | 3019 | | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
| 3023 | + | |
2898 | 3024 | | |
2899 | 3025 | | |
2900 | 3026 | | |
| |||
2920 | 3046 | | |
2921 | 3047 | | |
2922 | 3048 | | |
2923 | | - | |
| 3049 | + | |
2924 | 3050 | | |
2925 | 3051 | | |
2926 | 3052 | | |
| |||
4251 | 4377 | | |
4252 | 4378 | | |
4253 | 4379 | | |
4254 | | - | |
| 4380 | + | |
4255 | 4381 | | |
4256 | 4382 | | |
4257 | 4383 | | |
| |||
4438 | 4564 | | |
4439 | 4565 | | |
4440 | 4566 | | |
4441 | | - | |
| 4567 | + | |
4442 | 4568 | | |
4443 | 4569 | | |
4444 | 4570 | | |
| |||
0 commit comments