From b8a95e9446dd96b22d2c210e140f854b08d27c42 Mon Sep 17 00:00:00 2001 From: Keith Hall Date: Thu, 16 Jul 2020 05:49:43 +0300 Subject: [PATCH] [C#] scope event delegates correctly (#2317) --- C#/C#.sublime-syntax | 4 +++- C#/tests/syntax_test_GeneralStructure.cs | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/C#/C#.sublime-syntax b/C#/C#.sublime-syntax index ed494f8b25..675eafc7e6 100644 --- a/C#/C#.sublime-syntax +++ b/C#/C#.sublime-syntax @@ -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) @@ -1024,7 +1026,7 @@ contexts: - match: ';' scope: punctuation.terminator.statement.cs pop: true - - match: (?=\}|\)|>|\]) + - match: (?=[]})>;]) pop: true variables_declaration: diff --git a/C#/tests/syntax_test_GeneralStructure.cs b/C#/tests/syntax_test_GeneralStructure.cs index 59ea150aa0..2bd871132d 100755 --- a/C#/tests/syntax_test_GeneralStructure.cs +++ b/C#/tests/syntax_test_GeneralStructure.cs @@ -1324,4 +1324,17 @@ protected event EventHandler IDrawingObject.OnDraw /// ^^^^^^^^^^^^^^^^^^ support.type /// ^^^^^^^^^^^ variable.other.member /// ^ punctuation.terminator.statement + + Action actionDelegate = delegate { }; +/// ^ keyword.operator.assignment.variable +/// ^^^^^^^^ keyword.other +/// ^ punctuation.section.block.begin +/// ^ punctuation.section.block.end + event Action eventAction; +/// ^^^^^ storage.modifier + event Action eventActionDelegate = delegate { }; +/// ^ keyword.operator.assignment.variable +/// ^^^^^^^^ keyword.other +/// ^ punctuation.section.block.begin +/// ^ punctuation.section.block.end }