77
88name : C#
99scope : source.cs
10+ version : 2
1011
1112file_extensions :
1213 - cs
@@ -488,30 +489,27 @@ contexts:
488489 4 : storage.type.cs
489490 push :
490491 - meta_content_scope : meta.enum.cs
491- - match : (?=\{)
492+ - match : \{
493+ scope : punctuation.section.block.begin.cs
492494 set :
493- - match : \{
494- scope : punctuation.section.block.begin.cs
495- set :
496- - meta_scope : meta.enum.body.cs meta.block.cs
497- - match : \}
498- scope : punctuation.section.block.end.cs
499- set :
500- - match : ' ;'
501- scope : punctuation.terminator.statement.cs
502- pop : 1
503- - match : ' (?=\S)'
504- pop : 1
505- - include : attribute
506- - match : ' {{name}}'
507- scope : entity.name.constant.cs
508- - match : ' ='
509- scope : keyword.operator.assignment.cs
510- push :
511- - line_of_code_in
512- - maybe_pointer
513- - match : ' ,'
514- scope : punctuation.separator.enum.cs
495+ - meta_scope : meta.enum.body.cs meta.block.cs
496+ - match : \}
497+ scope : punctuation.section.block.end.cs
498+ set :
499+ - match : ' ;'
500+ scope : punctuation.terminator.statement.cs
501+ pop : 1
502+ - include : else_pop
503+ - include : attribute
504+ - match : ' {{name}}'
505+ scope : entity.name.constant.cs
506+ - match : ' ='
507+ scope : keyword.operator.assignment.cs
508+ push :
509+ - line_of_code_in
510+ - maybe_pointer
511+ - match : ' ,'
512+ scope : punctuation.separator.enum.cs
515513
516514# ##[ INTERFACE DECLARATIONS ]##################################################
517515
@@ -1111,13 +1109,13 @@ contexts:
11111109 set :
11121110 - meta_content_scope : meta.property.cs meta.block.cs
11131111 - match : \}
1114- scope : punctuation.section.block.end.cs
1112+ scope : meta.property.cs meta.block.cs punctuation.section.block.end.cs
11151113 set :
11161114 - meta_content_scope : meta.property.cs
11171115 - match : =
11181116 scope : keyword.operator.assignment.cs
11191117 set :
1120- - meta_content_scope : meta.property.cs
1118+ - meta_scope : meta.property.cs
11211119 - include : line_of_code_in
11221120 - include : else_pop
11231121 - match : (?:\b(readonly)\b\s+)?\b(get)\b
@@ -1134,7 +1132,7 @@ contexts:
11341132 - match : ' =>'
11351133 scope : keyword.declaration.function.arrow.cs
11361134 set :
1137- - meta_content_scope : meta.method .cs
1135+ - meta_content_scope : meta.property .cs
11381136 - include : line_of_code_in
11391137 - match : \S
11401138 scope : invalid.illegal.cs
@@ -1378,11 +1376,11 @@ contexts:
13781376 scope : meta.group.cs punctuation.section.group.end.cs
13791377 set :
13801378 - match : \{
1381- scope : meta.block.cs punctuation.section.block.begin.cs
1379+ scope : punctuation.section.block.begin.cs
13821380 set :
1383- - meta_content_scope : meta.block.cs
1381+ - meta_scope : meta.block.cs
13841382 - match : \}
1385- scope : meta.block.cs punctuation.section.block.end.cs
1383+ scope : punctuation.section.block.end.cs
13861384 pop : 1
13871385 - include : code_block_in
13881386 - match : (?=\S)
@@ -1405,40 +1403,37 @@ contexts:
14051403 - match : \)
14061404 scope : meta.group.cs punctuation.section.group.end.cs
14071405 set :
1408- - match : \{
1409- scope : punctuation.section.block.begin.cs
1410- set :
1411- - meta_scope : meta.block.cs
1412- - match : \}
1413- scope : punctuation.section.block.end.cs
1414- pop : 1
1415- - include : code_block_in
1416- - include : else_pop
1406+ - match : \{
1407+ scope : punctuation.section.block.begin.cs
1408+ set :
1409+ - meta_scope : meta.block.cs
1410+ - match : \}
1411+ scope : punctuation.section.block.end.cs
1412+ pop : 1
1413+ - include : code_block_in
1414+ - include : else_pop
14171415 - include : else_pop
14181416
14191417# ##[ CONDITIONAL STATEMENTS ]##################################################
14201418
14211419 if_condition :
1422- - match : ' \s*(\()'
1423- captures :
1424- 1 : meta.group.cs punctuation.section.group.begin.cs
1420+ - match : \(
1421+ scope : punctuation.section.group.begin.cs
14251422 set :
1426- - meta_content_scope : meta.group.cs
1427- - match : ' \s*(\))'
1428- captures :
1429- 1 : meta.group.cs punctuation.section.group.end.cs
1423+ - meta_scope : meta.group.cs
1424+ - match : \)
1425+ scope : punctuation.section.group.end.cs
14301426 pop : 1
14311427 - include : line_of_code_in
1432- - match : (?=[^(])
1433- pop : 1
1428+ - include : else_pop
14341429
14351430 if_block :
14361431 - match : \{
1437- scope : meta.block.cs punctuation.section.block.begin.cs
1432+ scope : punctuation.section.block.begin.cs
14381433 set :
1439- - meta_content_scope : meta.block.cs
1434+ - meta_scope : meta.block.cs
14401435 - match : \}
1441- scope : meta.block.cs punctuation.section.block.end.cs
1436+ scope : punctuation.section.block.end.cs
14421437 pop : 1
14431438 - include : code_block_in
14441439 - match : (?=\S)
@@ -1448,32 +1443,30 @@ contexts:
14481443 - include : line_of_code
14491444
14501445 else_block :
1451- - match : (else\s+if)\b\s*
1452- captures :
1453- 1 : keyword.control.conditional.elseif.cs
1446+ - match : else\s+if\b
1447+ scope : keyword.control.conditional.elseif.cs
14541448 push : [if_block, if_condition]
1455- - match : ( else)\s*
1449+ - match : else\b
14561450 scope : keyword.control.conditional.else.cs
14571451 set :
1458- - match : \s*(\{)
1459- captures :
1460- 1 : meta.block.cs punctuation.section.block.begin.cs
1452+ - match : \{
1453+ scope : punctuation.section.block.begin.cs
14611454 set :
1462- - meta_content_scope : meta.block.cs
1455+ - meta_scope : meta.block.cs
14631456 - match : \}
1464- scope : meta.block.cs punctuation.section.block.end.cs
1457+ scope : punctuation.section.block.end.cs
14651458 pop : 1
14661459 - include : code_block_in
14671460 - match : (?=\S)
14681461 set : line_of_code
14691462 - include : else_pop
14701463
14711464 switch_condition :
1472- - match : ' \( '
1465+ - match : \(
14731466 scope : punctuation.section.group.begin.cs
14741467 set :
14751468 - meta_scope : meta.group.cs
1476- - match : ' \) '
1469+ - match : \)
14771470 scope : punctuation.section.group.end.cs
14781471 pop : 1
14791472 - include : line_of_code_in
@@ -1596,7 +1589,7 @@ contexts:
15961589 for_block :
15971590 - meta_content_scope : meta.group.cs
15981591 - match : \)
1599- scope : punctuation.section.group.end.cs
1592+ scope : meta.group.cs punctuation.section.group.end.cs
16001593 set :
16011594 - match : \{
16021595 scope : punctuation.section.block.begin.cs
@@ -1607,8 +1600,7 @@ contexts:
16071600 pop : 1
16081601 - include : code_block_in
16091602 - match : (?=\S)
1610- set :
1611- - include : line_of_code
1603+ set : line_of_code
16121604
16131605 do_condition :
16141606 - match : \b(while)\b
@@ -1632,13 +1624,12 @@ contexts:
16321624 scope : punctuation.section.block.begin.cs
16331625 set :
16341626 - meta_scope : meta.block.cs
1635- - match : ' \} '
1627+ - match : \}
16361628 scope : punctuation.section.block.end.cs
16371629 pop : 1
16381630 - include : code_block_in
16391631 - match : (?=\S)
1640- set :
1641- - include : line_of_code
1632+ set : line_of_code
16421633
16431634# ##[ EXPRESSIONS ]#############################################################
16441635
@@ -1707,7 +1698,7 @@ contexts:
17071698 - match : ' ,'
17081699 scope : punctuation.separator.type.cs
17091700 - match : ' >'
1710- scope : punctuation.definition.generic.end.cs
1701+ scope : meta.generic.cs punctuation.definition.generic.end.cs
17111702 set : function_call_begin_paren
17121703 - include : type
17131704 - match : ({{name}})(<)(?={{namespaced_name}}>\s*\.)
@@ -1900,7 +1891,7 @@ contexts:
19001891 - match : (?=[^{\s])
19011892 # This is not an anonymous class
19021893 set :
1903- - meta_content_scope : meta.instance.cs
1894+ - meta_scope : meta.instance.cs
19041895 - match : ' {{brackets_capture}}'
19051896 captures :
19061897 1 : meta.brackets.cs
@@ -1920,7 +1911,6 @@ contexts:
19201911 - match : ' (?=\S)'
19211912 push : line_of_code_in
19221913 - match : (?:\s*((\()\s*(\)))\s*)?(\{)
1923- scope : meta.instance.cs
19241914 captures :
19251915 1 : meta.group.cs
19261916 2 : punctuation.section.group.begin.cs
@@ -2027,7 +2017,7 @@ contexts:
20272017 constructor_arguments :
20282018 - meta_content_scope : meta.instance.cs meta.group.cs
20292019 - match : \)
2030- scope : punctuation.section.group.end.cs
2020+ scope : meta.instance.cs meta.group.cs punctuation.section.group.end.cs
20312021 set : maybe_constructor_initializer
20322022 - include : maybe_constructor_initializer
20332023
@@ -2036,7 +2026,7 @@ contexts:
20362026 - match : (?=[^\s{])
20372027 pop : 1
20382028 - match : \{
2039- scope : punctuation.section.braces.begin.cs
2029+ scope : meta.instance.cs meta.braces.cs punctuation.section.braces.begin.cs
20402030 set : initializer_constructor
20412031
20422032 initializer_constructor :
@@ -2045,7 +2035,7 @@ contexts:
20452035 scope : meta.instance.cs meta.braces.cs punctuation.section.braces.end.cs
20462036 pop : 1
20472037 - match : \{
2048- scope : punctuation.section.braces.begin.cs
2038+ scope : meta.instance.cs meta.braces.cs punctuation.section.braces.begin.cs
20492039 push : initializer_constructor
20502040 - match : ' ,'
20512041 scope : punctuation.separator.array-element.cs
@@ -2057,7 +2047,7 @@ contexts:
20572047 function_call_begin_paren :
20582048 - meta_content_scope : meta.function-call.cs
20592049 - match : \(
2060- scope : meta.group.cs punctuation.section.group.begin.cs
2050+ scope : meta.function-call.cs meta. group.cs punctuation.section.group.begin.cs
20612051 set : [function_call_arguments, arguments]
20622052 - include : else_pop
20632053
@@ -2189,14 +2179,14 @@ contexts:
21892179
21902180 maybe_pattern_matching_object :
21912181 - match : \{
2192- scope : meta.instance.property-subpattern.cs meta.class.body.anonymous.cs meta.block.cs punctuation.section.block.begin.cs
2182+ scope : punctuation.section.block.begin.cs
21932183 set : pattern_matching_object
21942184 - include : else_pop
21952185
21962186 pattern_matching_object :
2197- - meta_content_scope : meta.instance.property-subpattern.cs meta.class.body.anonymous.cs meta.block.cs
2187+ - meta_scope : meta.instance.property-subpattern.cs meta.class.body.anonymous.cs meta.block.cs
21982188 - match : \}
2199- scope : meta.instance.property-subpattern.cs meta.class.body.anonymous.cs meta.block.cs punctuation.section.block.end.cs
2189+ scope : punctuation.section.block.end.cs
22002190 pop : 1
22012191 - match : ' ,'
22022192 scope : punctuation.separator.property.cs
@@ -2453,20 +2443,20 @@ contexts:
24532443
24542444 regex_string :
24552445 - match : ' "'
2456- scope : punctuation.definition.string.begin.cs
2446+ scope : meta.string.cs string.quoted.double.cs punctuation.definition.string.begin.cs
24572447 embed : scope:source.regexp
2458- embed_scope : meta.string.cs meta.regexp.cs
2448+ embed_scope : meta.string.cs string.quoted.double.cs source.regexp
24592449 escape : ' "'
24602450 escape_captures :
2461- 0 : punctuation.definition.string.end.cs
2451+ 0 : meta.string.cs string.quoted.double.cs punctuation.definition.string.end.cs
24622452 pop : 1
24632453 - match : ' @"'
2464- scope : punctuation.definition.string.begin.cs
2454+ scope : meta.string.cs string.quoted.double.verbatim.cs punctuation.definition.string.begin.cs
24652455 embed : scope:source.regexp
2466- embed_scope : meta.string.cs meta.regexp.cs
2456+ embed_scope : meta.string.cs string.quoted.double.verbatim.cs source.regexp
24672457 escape : ' "'
24682458 escape_captures :
2469- 0 : punctuation.definition.string.end.cs
2459+ 0 : meta.string.cs string.quoted.double.verbatim.cs punctuation.definition.string.end.cs
24702460 pop : 1
24712461 - include : else_pop
24722462
0 commit comments