diff --git a/C#/C#.sublime-syntax b/C#/C#.sublime-syntax index 65cfb5be35..b351ef9169 100644 --- a/C#/C#.sublime-syntax +++ b/C#/C#.sublime-syntax @@ -553,10 +553,31 @@ contexts: - include: type_constraint_common - match: '{{name}}' scope: entity.other.inherited-class.cs - push: - - function_call_begin_paren + push: inherited_class_arguments - include: type + inherited_class_arguments: + - match: (?=\() + push: [inside_inherited_class_arguments, arguments, inherited_class_arguments-begin] + - match: (?=\S) + pop: true + + inherited_class_arguments-begin: + - meta_include_prototype: false + - match: \( + scope: punctuation.section.group.begin.cs + pop: true + + inside_inherited_class_arguments: + - clear_scopes: 1 + - meta_include_prototype: false + - meta_scope: meta.class.constructor.arguments.cs meta.group.cs + - match: \) + scope: punctuation.section.group.end.cs + pop: true + - match: '' + pop: true + type_constraint_common: - match: (?=\{) pop: true diff --git a/C#/tests/syntax_test_C#12.cs b/C#/tests/syntax_test_C#12.cs index b23910be4a..c48ffe6f63 100644 --- a/C#/tests/syntax_test_C#12.cs +++ b/C#/tests/syntax_test_C#12.cs @@ -10,10 +10,10 @@ public class InvalidException(string _message) : Exception(_message); /// ^^^^^^ storage.type.cs /// ^^^^^^^^ variable.parameter.cs /// ^ punctuation.section.parameters.end.cs -/// ^^^^^^^^^^^^^^^^^^^^^^^ meta.class.cs +/// ^^^^^^^^^^^^ meta.class.cs /// ^ punctuation.separator.type.cs /// ^^^^^^^^^ entity.other.inherited-class.cs -/// ^^^^^^^^^^ meta.function-call.cs meta.group.cs +/// ^^^^^^^^^^ meta.class.constructor.arguments.cs meta.group.cs /// ^ punctuation.section.group.begin.cs /// ^^^^^^^^ variable.other.cs /// ^ punctuation.section.group.end.cs @@ -30,10 +30,10 @@ public class NotFoundException(string _message) : Exception(_message); /// ^^^^^^ storage.type.cs /// ^^^^^^^^ variable.parameter.cs /// ^ punctuation.section.parameters.end.cs -/// ^^^^^^^^^^^^^^^^^^^^^^^ meta.class.cs +/// ^^^^^^^^^^^^ meta.class.cs /// ^ punctuation.separator.type.cs /// ^^^^^^^^^ entity.other.inherited-class.cs -/// ^^^^^^^^^^ meta.function-call.cs meta.group.cs +/// ^^^^^^^^^^ meta.class.constructor.arguments.cs meta.group.cs /// ^ punctuation.section.group.begin.cs /// ^^^^^^^^ variable.other.cs /// ^ punctuation.section.group.end.cs