|
275 | 275 | <key>include</key>
|
276 | 276 | <string>#support-objects</string>
|
277 | 277 | </dict>
|
| 278 | + <dict> |
| 279 | + <key>include</key> |
| 280 | + <string>#paren-expression-possibly-arrow</string> |
| 281 | + </dict> |
278 | 282 | <dict>
|
279 | 283 | <key>include</key>
|
280 | 284 | <string>#paren-expression</string>
|
|
414 | 418 | ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
415 | 419 | )) |
|
416 | 420 | ((async\s*)?(
|
| 421 | + ([\(]\s*$) | # during lookup treat ( followed by line end as arrow |
417 | 422 | # sure shot arrow functions even if => is on new line
|
418 | 423 | (
|
419 | 424 | [(]\s*
|
|
429 | 434 | (
|
430 | 435 | (<\s*([_$[:alpha:]]|(\{[^\{\}]*\})|(\([^\(\)]*\))|(\[[^\[\]]*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{[^\{\}]*\})|(\([^\(\)]*\))|(\[[^\[\]]*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
|
431 | 436 | \(\s*([_$[:alpha:]\{\[]([^()]|\((\s*[^()]*)?\))*)?\) # parameteres
|
432 |
| - (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type |
| 437 | + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type |
433 | 438 | \s*=> # arrow operator
|
434 | 439 | )
|
435 | 440 | ))
|
|
802 | 807 | ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
803 | 808 | )) |
|
804 | 809 | ((async\s*)?(
|
| 810 | + ([\(]\s*$) | # during lookup treat ( followed by line end as arrow |
805 | 811 | # sure shot arrow functions even if => is on new line
|
806 | 812 | (
|
807 | 813 | [(]\s*
|
|
817 | 823 | (
|
818 | 824 | (<\s*([_$[:alpha:]]|(\{[^\{\}]*\})|(\([^\(\)]*\))|(\[[^\[\]]*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{[^\{\}]*\})|(\([^\(\)]*\))|(\[[^\[\]]*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
|
819 | 825 | \(\s*([_$[:alpha:]\{\[]([^()]|\((\s*[^()]*)?\))*)?\) # parameteres
|
820 |
| - (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type |
| 826 | + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type |
821 | 827 | \s*=> # arrow operator
|
822 | 828 | )
|
823 | 829 | ))
|
|
1188 | 1194 | ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
1189 | 1195 | )) |
|
1190 | 1196 | ((async\s*)?(
|
| 1197 | + ([\(]\s*$) | # during lookup treat ( followed by line end as arrow |
1191 | 1198 | # sure shot arrow functions even if => is on new line
|
1192 | 1199 | (
|
1193 | 1200 | [(]\s*
|
|
1203 | 1210 | (
|
1204 | 1211 | (<\s*([_$[:alpha:]]|(\{[^\{\}]*\})|(\([^\(\)]*\))|(\[[^\[\]]*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{[^\{\}]*\})|(\([^\(\)]*\))|(\[[^\[\]]*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
|
1205 | 1212 | \(\s*([_$[:alpha:]\{\[]([^()]|\((\s*[^()]*)?\))*)?\) # parameteres
|
1206 |
| - (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type |
| 1213 | + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type |
1207 | 1214 | \s*=> # arrow operator
|
1208 | 1215 | )
|
1209 | 1216 | ))
|
|
1644 | 1651 | (
|
1645 | 1652 | (<\s*([_$[:alpha:]]|(\{[^\{\}]*\})|(\([^\(\)]*\))|(\[[^\[\]]*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{[^\{\}]*\})|(\([^\(\)]*\))|(\[[^\[\]]*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
|
1646 | 1653 | \(\s*([_$[:alpha:]\{\[]([^()]|\((\s*[^()]*)?\))*)?\) # parameteres
|
1647 |
| - (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type |
| 1654 | + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type |
1648 | 1655 | \s*=> # arrow operator
|
1649 | 1656 | )
|
1650 | 1657 | )
|
|
1831 | 1838 | <string>punctuation.definition.parameters.end.ts</string>
|
1832 | 1839 | </dict>
|
1833 | 1840 | </dict>
|
| 1841 | + <key>patterns</key> |
| 1842 | + <array> |
| 1843 | + <dict> |
| 1844 | + <key>include</key> |
| 1845 | + <string>#function-parameters-body</string> |
| 1846 | + </dict> |
| 1847 | + </array> |
| 1848 | + </dict> |
| 1849 | + <key>function-parameters-body</key> |
| 1850 | + <dict> |
1834 | 1851 | <key>patterns</key>
|
1835 | 1852 | <array>
|
1836 | 1853 | <dict>
|
|
3100 | 3117 | ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
3101 | 3118 | )) |
|
3102 | 3119 | ((async\s*)?(
|
| 3120 | + ([\(]\s*$) | # during lookup treat ( followed by line end as arrow |
3103 | 3121 | # sure shot arrow functions even if => is on new line
|
3104 | 3122 | (
|
3105 | 3123 | [(]\s*
|
|
3115 | 3133 | (
|
3116 | 3134 | (<\s*([_$[:alpha:]]|(\{[^\{\}]*\})|(\([^\(\)]*\))|(\[[^\[\]]*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{[^\{\}]*\})|(\([^\(\)]*\))|(\[[^\[\]]*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
|
3117 | 3135 | \(\s*([_$[:alpha:]\{\[]([^()]|\((\s*[^()]*)?\))*)?\) # parameteres
|
3118 |
| - (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type |
| 3136 | + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type |
3119 | 3137 | \s*=> # arrow operator
|
3120 | 3138 | )
|
3121 | 3139 | ))
|
|
3383 | 3401 | </dict>
|
3384 | 3402 | </array>
|
3385 | 3403 | </dict>
|
| 3404 | + <key>paren-expression-possibly-arrow</key> |
| 3405 | + <dict> |
| 3406 | + <key>patterns</key> |
| 3407 | + <array> |
| 3408 | + <dict> |
| 3409 | + <key>begin</key> |
| 3410 | + <string>(\()(?=\s*$)</string> |
| 3411 | + <key>beginCaptures</key> |
| 3412 | + <dict> |
| 3413 | + <key>1</key> |
| 3414 | + <dict> |
| 3415 | + <key>name</key> |
| 3416 | + <string>meta.brace.round.ts</string> |
| 3417 | + </dict> |
| 3418 | + </dict> |
| 3419 | + <key>end</key> |
| 3420 | + <string>\)</string> |
| 3421 | + <key>endCaptures</key> |
| 3422 | + <dict> |
| 3423 | + <key>0</key> |
| 3424 | + <dict> |
| 3425 | + <key>name</key> |
| 3426 | + <string>meta.brace.round.ts</string> |
| 3427 | + </dict> |
| 3428 | + </dict> |
| 3429 | + <key>patterns</key> |
| 3430 | + <array> |
| 3431 | + <dict> |
| 3432 | + <key>include</key> |
| 3433 | + <string>#expressionWithoutIdentifiers</string> |
| 3434 | + </dict> |
| 3435 | + <dict> |
| 3436 | + <key>include</key> |
| 3437 | + <string>#function-parameters-body</string> |
| 3438 | + </dict> |
| 3439 | + <dict> |
| 3440 | + <key>include</key> |
| 3441 | + <string>#identifiers</string> |
| 3442 | + </dict> |
| 3443 | + <dict> |
| 3444 | + <key>include</key> |
| 3445 | + <string>#expressionPunctuations</string> |
| 3446 | + </dict> |
| 3447 | + </array> |
| 3448 | + </dict> |
| 3449 | + <dict> |
| 3450 | + <key>include</key> |
| 3451 | + <string>#possibly-arrow-return-type</string> |
| 3452 | + </dict> |
| 3453 | + </array> |
| 3454 | + </dict> |
3386 | 3455 | <key>paren-expression</key>
|
3387 | 3456 | <dict>
|
3388 | 3457 | <key>begin</key>
|
|
3411 | 3480 | <key>include</key>
|
3412 | 3481 | <string>#expression</string>
|
3413 | 3482 | </dict>
|
3414 |
| - <dict> |
3415 |
| - <key>include</key> |
3416 |
| - <string>#punctuation-comma</string> |
3417 |
| - </dict> |
3418 | 3483 | </array>
|
3419 | 3484 | </dict>
|
3420 | 3485 | <key>cast</key>
|
|
4337 | 4402 | ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
4338 | 4403 | )) |
|
4339 | 4404 | ((async\s*)?(
|
| 4405 | + ([\(]\s*$) | # during lookup treat ( followed by line end as arrow |
4340 | 4406 | # sure shot arrow functions even if => is on new line
|
4341 | 4407 | (
|
4342 | 4408 | [(]\s*
|
|
4352 | 4418 | (
|
4353 | 4419 | (<\s*([_$[:alpha:]]|(\{[^\{\}]*\})|(\([^\(\)]*\))|(\[[^\[\]]*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{[^\{\}]*\})|(\([^\(\)]*\))|(\[[^\[\]]*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
|
4354 | 4420 | \(\s*([_$[:alpha:]\{\[]([^()]|\((\s*[^()]*)?\))*)?\) # parameteres
|
4355 |
| - (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type |
| 4421 | + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type |
4356 | 4422 | \s*=> # arrow operator
|
4357 | 4423 | )
|
4358 | 4424 | ))
|
|
4627 | 4693 | </dict>
|
4628 | 4694 | <key>end</key>
|
4629 | 4695 | <string>(?==>|\{|(^\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\s+))</string>
|
| 4696 | + <key>patterns</key> |
| 4697 | + <array> |
| 4698 | + <dict> |
| 4699 | + <key>include</key> |
| 4700 | + <string>#arrow-return-type-body</string> |
| 4701 | + </dict> |
| 4702 | + </array> |
| 4703 | + </dict> |
| 4704 | + <key>possibly-arrow-return-type</key> |
| 4705 | + <dict> |
| 4706 | + <key>begin</key> |
| 4707 | + <string>(?<=\))\s*(:)(?=\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+\s*=>)</string> |
| 4708 | + <key>beginCaptures</key> |
| 4709 | + <dict> |
| 4710 | + <key>1</key> |
| 4711 | + <dict> |
| 4712 | + <key>name</key> |
| 4713 | + <string>meta.arrow.ts meta.return.type.arrow.ts keyword.operator.type.annotation.ts</string> |
| 4714 | + </dict> |
| 4715 | + </dict> |
| 4716 | + <key>end</key> |
| 4717 | + <string>(?==>|\{|(^\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\s+))</string> |
| 4718 | + <key>contentName</key> |
| 4719 | + <string>meta.arrow.ts meta.return.type.arrow.ts</string> |
| 4720 | + <key>patterns</key> |
| 4721 | + <array> |
| 4722 | + <dict> |
| 4723 | + <key>include</key> |
| 4724 | + <string>#arrow-return-type-body</string> |
| 4725 | + </dict> |
| 4726 | + </array> |
| 4727 | + </dict> |
| 4728 | + <key>arrow-return-type-body</key> |
| 4729 | + <dict> |
4630 | 4730 | <key>patterns</key>
|
4631 | 4731 | <array>
|
4632 | 4732 | <dict>
|
|
0 commit comments