Skip to content

Commit

Permalink
[C#] Inherited class arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe authored and keith-hall committed Jan 8, 2025
1 parent 3a5f3fd commit 4dd35af
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
25 changes: 23 additions & 2 deletions C#/C#.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions C#/tests/syntax_test_C#12.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 4dd35af

Please sign in to comment.