@@ -174,6 +174,11 @@ contexts:
174
174
- include : comments
175
175
- match : $
176
176
pop : true
177
+ - match : ' \b(nullable)\s+(enable|disable|restore)(?:\s+(annotations|warnings))?\b'
178
+ captures :
179
+ 1 : keyword.other.preprocessor.cs
180
+ 2 : keyword.other.preprocessor.cs
181
+ 3 : keyword.other.preprocessor.cs
177
182
- match : .*
178
183
scope : invalid.illegal.cs
179
184
- match : $
@@ -216,6 +221,8 @@ contexts:
216
221
scope : invalid.illegal.stray.brace.cs
217
222
218
223
using :
224
+ - match : \bglobal\b
225
+ scope : storage.modifier.cs
219
226
- match : ' \b(using)\s+(?={{name}}\s*=\s*)'
220
227
captures :
221
228
1 : keyword.control.import.cs
@@ -243,7 +250,7 @@ contexts:
243
250
- match : ' ='
244
251
scope : keyword.operator.assignment.cs
245
252
- match : \.
246
- scope : punctuation.separator.namespace.cs
253
+ scope : meta.path.cs punctuation.separator.namespace.cs
247
254
- match : ' <'
248
255
scope : meta.generic.cs punctuation.definition.generic.begin.cs
249
256
push : type_argument
@@ -290,10 +297,12 @@ contexts:
290
297
1 : storage.type.class.cs
291
298
2 : entity.name.class.cs
292
299
push : [class_signature, data_type_signature]
293
- - match : \b(record)\s+({{name}})
300
+ - match : (?: \b(readonly)\s+)?\b( record)\s+(?:(struct)\s+)? ({{name}})
294
301
captures :
295
- 1 : storage.type.class.record.cs
296
- 2 : entity.name.class.cs
302
+ 1 : storage.modifier.cs
303
+ 2 : storage.type.class.record.cs
304
+ 3 : storage.type.struct.record.cs
305
+ 4 : entity.name.class.cs
297
306
push : [record_signature, data_type_signature]
298
307
- match : ' (?:\b(readonly)\s+)?(?:\b(ref)\s+)?\b(struct)\s+({{name}})'
299
308
captures :
@@ -514,7 +523,7 @@ contexts:
514
523
- match : ' ({{name}})?(\.)'
515
524
captures :
516
525
1 : meta.path.cs
517
- 2 : punctuation.accessor.dot.namespace.cs
526
+ 2 : meta.path.cs punctuation.accessor.dot.namespace.cs
518
527
- match : ' ,'
519
528
scope : punctuation.separator.inherited-class.cs
520
529
@@ -564,12 +573,12 @@ contexts:
564
573
scope : storage.modifier.access.cs
565
574
- match : ' \boperator\b'
566
575
scope : storage.modifier.cs
567
- push : method_name
576
+ push : method_name_or_member_variable
568
577
- match : ' ({{name}})\s*(<)'
569
578
captures :
570
579
1 : support.type.cs
571
580
2 : meta.generic.cs punctuation.definition.generic.begin.cs
572
- push : [method_name , type_argument]
581
+ push : [method_name_or_member_variable , type_argument]
573
582
- match : ' (~{{name}})(\s*)(\()'
574
583
captures :
575
584
1 : meta.method.cs entity.name.function.destructor.cs
@@ -599,11 +608,11 @@ contexts:
599
608
5 : punctuation.section.brackets.end.cs
600
609
6 : keyword.operator.pointer.cs
601
610
- match : ' '
602
- set : method_name
611
+ set : method_name_or_member_variable
603
612
- match : (?=\()
604
- push : [method_name , type_tuple]
613
+ push : [method_name_or_member_variable , type_tuple]
605
614
606
- method_name : # also matches member variables
615
+ method_name_or_member_variable :
607
616
- match : ' \.'
608
617
scope : punctuation.accessor.dot.cs
609
618
- match : ' (operator)\s*({{unary_op}}|{{bin_op}})\s*(\()'
@@ -612,31 +621,45 @@ contexts:
612
621
2 : meta.method.cs entity.name.function.cs
613
622
3 : meta.method.parameters.cs punctuation.section.parameters.begin.cs
614
623
set : [method_body_transition, method_params]
615
- - match : ' ({{name}}\s*)?((=>)\s*)'
624
+ - match : (?={{name}})
625
+ branch_point : method_or_member_variable_name
626
+ branch :
627
+ - member_lambda_or_plain
628
+ - method_name
629
+ pop : true
630
+
631
+ member_lambda_or_plain :
632
+ - match : ({{name}})\s*(=>)
633
+ scope : meta.method.cs
616
634
captures :
617
635
1 : variable.other.member.cs
618
- 2 : meta.method.cs
619
- 3 : keyword.declaration.function.accessor.get.cs
636
+ 2 : keyword.declaration.function.accessor.get.cs
620
637
set :
621
638
- meta_scope : meta.property.cs
622
639
- meta_content_scope : meta.method.cs
623
640
- include : line_of_code_in
624
- - match : ' ({{name}})\s*(?==[^>])'
625
- captures :
626
- 1 : variable.other.member.cs
641
+ - match : (?={{namespaced_name}}\s+{{name}}\s+=>)
642
+ pop : true
643
+ - match : ' {{name}}'
644
+ scope : variable.other.member.cs
645
+ - match : (?==[^>])
627
646
set : member_variables_declaration
647
+ - match : ' ;'
648
+ scope : punctuation.terminator.statement.cs
649
+ pop : true
650
+ - match : (?=\})
651
+ pop : true
652
+ - match : (?=\S)
653
+ fail : method_or_member_variable_name
654
+
655
+ method_name :
628
656
- match : ' ({{name}})?\s*(\()'
629
- # here the name is optionnal since it may already have been match by
657
+ # here the name is optional since it may already have been matched by
630
658
# '{{name}}\s*(<)' (see rule below)
631
659
captures :
632
660
1 : meta.method.cs entity.name.function.cs
633
661
2 : meta.method.parameters.cs punctuation.section.parameters.begin.cs
634
662
set : [method_body_transition, method_params]
635
- - match : ' ({{name}})\s*(;)'
636
- captures :
637
- 1 : variable.other.member.cs
638
- 2 : punctuation.terminator.statement.cs
639
- pop : true
640
663
- match : ' ({{name}})\s*(<)(?=[^(]*>\.)'
641
664
scope : meta.method.cs
642
665
captures :
@@ -682,6 +705,9 @@ contexts:
682
705
pop : true
683
706
- match : ' (?=\s*\{)'
684
707
set : method_accessor
708
+ - match : ' ;'
709
+ scope : punctuation.terminator.statement.cs
710
+ pop : true
685
711
686
712
method_body_transition :
687
713
- match : ' '
@@ -838,7 +864,7 @@ contexts:
838
864
839
865
attribute_in :
840
866
- meta_scope : meta.annotation.cs
841
- - match : ' ({{name}})(\()'
867
+ - match : ' ({{name}})\s* (\()'
842
868
captures :
843
869
1 : variable.annotation.cs
844
870
2 : meta.group.cs punctuation.section.group.begin.cs
0 commit comments