Skip to content

Commit

Permalink
[C#] scope event delegates correctly (#2317)
Browse files Browse the repository at this point in the history
  • Loading branch information
keith-hall authored Jul 16, 2020
1 parent e167af9 commit b8a95e9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion C#/C#.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,8 @@ contexts:
- match: \b(remove)\b
scope: storage.type.function.accessor.remove.cs
push: method_body
- match: (?==)
set: member_variables_declaration
- match: (?=\S)
pop: true
- match: (?=\S)
Expand Down Expand Up @@ -1024,7 +1026,7 @@ contexts:
- match: ';'
scope: punctuation.terminator.statement.cs
pop: true
- match: (?=\}|\)|>|\])
- match: (?=[]})>;])
pop: true

variables_declaration:
Expand Down
13 changes: 13 additions & 0 deletions C#/tests/syntax_test_GeneralStructure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1324,4 +1324,17 @@ protected event EventHandler IDrawingObject.OnDraw
/// ^^^^^^^^^^^^^^^^^^ support.type
/// ^^^^^^^^^^^ variable.other.member
/// ^ punctuation.terminator.statement

Action<float> actionDelegate = delegate { };
/// ^ keyword.operator.assignment.variable
/// ^^^^^^^^ keyword.other
/// ^ punctuation.section.block.begin
/// ^ punctuation.section.block.end
event Action<float> eventAction;
/// ^^^^^ storage.modifier
event Action<float> eventActionDelegate = delegate { };
/// ^ keyword.operator.assignment.variable
/// ^^^^^^^^ keyword.other
/// ^ punctuation.section.block.begin
/// ^ punctuation.section.block.end
}

0 comments on commit b8a95e9

Please sign in to comment.