From 8c77f7f500bcc40a9101d19791943c3f50099127 Mon Sep 17 00:00:00 2001 From: Ivan Zlatev Date: Thu, 18 Aug 2016 14:42:18 +0100 Subject: [PATCH] Fix highlighting of nested namespaces and using statements. Fixes #282, #849, #381 Also the below which are tracked here: #101 https://github.com/Microsoft/vscode/issues/849 https://github.com/Microsoft/vscode/issues/848 --- syntaxes/csharp.json | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/syntaxes/csharp.json b/syntaxes/csharp.json index ff1ed791b..decd9fadb 100644 --- a/syntaxes/csharp.json +++ b/syntaxes/csharp.json @@ -8,16 +8,26 @@ "foldingStopMarker": "^\\s*#\\s*endregion|^\\s*\\*/|^\\s*\\}", "patterns": [ { + "include": "#using" + }, + { + "include": "#namespace" + }, + { + "include": "#code" + } + ], + "repository": { + "using": { + "begin": "^\\s*(using)\\b\\s*", "captures": { "1": { "name": "keyword.other.using.cs" } }, - "begin": "^\\s*(using)\\b\\s*", - "end": "\\s*(?:$|(;))", - "name": "meta.keyword.using.cs" + "end": "\\s*(?:$|;)" }, - { + "namespace": { "begin": "^\\s*((namespace)\\s+([\\w.]+))", "beginCaptures": { "1": { @@ -48,6 +58,12 @@ "end": "(?=})", "name": "meta.namespace.body.cs", "patterns": [ + { + "include": "#using" + }, + { + "include": "#namespace" + }, { "include": "#code" } @@ -55,11 +71,6 @@ } ] }, - { - "include": "#code" - } - ], - "repository": { "block": { "patterns": [ {