{ "scopeName": "source.cs", "name": "C#", "fileTypes": [ "cs" ], "foldingStartMarker": "^\\s*#\\s*region|^\\s*/\\*|^(?![^{]*?//|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|//|/\\*(?!.*?\\*/.*\\S))", "foldingStopMarker": "^\\s*#\\s*endregion|^\\s*\\*/|^\\s*\\}", "patterns": [ { "include": "#using" }, { "include": "#namespace" }, { "include": "#code" } ], "repository": { "using": { "begin": "^\\s*(using)\\b\\s+(static)?\\b\\s*([\\w.]+)", "beginCaptures": { "1": { "name": "keyword.other.using.cs" }, "2": { "name": "keyword.other.using.cs" }, "3": { "name": "entity.name.type.namespace.cs" } }, "end": "\\s*(?:$|(;))" }, "namespace": { "begin": "^\\s*((namespace)\\s+([\\w.]+))", "beginCaptures": { "1": { "name": "meta.namespace.identifier.cs" }, "2": { "name": "keyword.other.namespace.cs" }, "3": { "name": "entity.name.type.namespace.cs" } }, "end": "}", "endCaptures": { "0": { "name": "punctuation.section.namespace.end.cs" } }, "name": "meta.namespace.cs", "patterns": [ { "begin": "{", "beginCaptures": { "0": { "name": "punctuation.section.namespace.begin.cs" } }, "end": "(?=})", "name": "meta.namespace.body.cs", "patterns": [ { "include": "#using" }, { "include": "#namespace" }, { "include": "#code" } ] } ] }, "block": { "patterns": [ { "begin": "{", "beginCaptures": { "0": { "name": "punctuation.section.block.begin.cs" } }, "end": "}", "endCaptures": { "0": { "name": "punctuation.section.block.end.cs" } }, "name": "meta.block.cs", "patterns": [ { "include": "#code" } ] } ] }, "builtinTypes": { "patterns": [ { "match": "\\b(bool|byte|sbyte|char|decimal|double|float|int|uint|long|ulong|object|short|ushort|string|void|class|struct|enum|interface|dynamic)\\b", "name": "storage.type.cs" } ] }, "class": { "begin": "(?=\\w?[\\w\\s]*(?:class|struct|interface|enum)\\s+\\w+)", "end": "}", "endCaptures": { "0": { "name": "punctuation.section.class.end.cs" } }, "name": "meta.class.cs", "patterns": [ { "include": "#storage-modifiers" }, { "include": "#comments" }, { "captures": { "1": { "name": "storage.modifier.cs" }, "2": { "name": "entity.name.type.class.cs" } }, "match": "(class|struct|interface|enum)\\s+(\\w+)", "name": "meta.class.identifier.cs" }, { "begin": ":", "end": "(?={)", "patterns": [ { "captures": { "1": { "name": "storage.type.cs" } }, "match": "\\s*,?([A-Za-z_]\\w*)\\b" } ] }, { "begin": "{", "beginCaptures": { "0": { "name": "punctuation.section.class.begin.cs" } }, "end": "(?=})", "name": "meta.class.body.cs", "patterns": [ { "include": "#method" }, { "include": "#code" } ] } ] }, "code": { "patterns": [ { "include": "#block" }, { "include": "#comments" }, { "include": "#class" }, { "include": "#constants" }, { "include": "#storage-modifiers" }, { "include": "#keywords" }, { "include": "#preprocessor" }, { "include": "#method-call" }, { "include": "#builtinTypes" }, { "include": "#documentation" } ] }, "comments": { "patterns": [ { "begin": "///", "captures": { "0": { "name": "punctuation.definition.comment.cs" } }, "end": "$\\n?", "name": "comment.block.documentation.cs", "patterns": [ { "include": "text.xml" } ] }, { "begin": "/\\*", "captures": { "0": { "name": "punctuation.definition.comment.cs" } }, "end": "\\*/\\n?", "name": "comment.block.cs" }, { "begin": "//", "captures": { "1": { "name": "punctuation.definition.comment.cs" } }, "end": "$\\n?", "name": "comment.line.double-slash.cs" } ] }, "constants": { "patterns": [ { "match": "\\b(true|false|null|this|base)\\b", "name": "constant.language.cs" }, { "match": "\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b", "name": "constant.numeric.cs" }, { "captures": { "0": { "name": "punctuation.definition.string.begin.cs" } }, "match": "@\"([^\"]|\"\")*\"", "name": "string.quoted.double.literal.cs" }, { "begin": "\"", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.cs" } }, "end": "\"", "endCaptures": { "0": { "name": "punctuation.definition.string.end.cs" } }, "name": "string.quoted.double.cs", "patterns": [ { "match": "\\\\.", "name": "constant.character.escape.cs" } ] }, { "begin": "'", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.cs" } }, "end": "'", "endCaptures": { "0": { "name": "punctuation.definition.string.end.cs" } }, "name": "string.quoted.single.cs", "patterns": [ { "match": "\\\\.", "name": "constant.character.escape.cs" } ] } ] }, "keywords": { "patterns": [ { "match": "\\b(if|else|while|for|foreach|in|do|return|continue|break|switch|case|default|goto|throw|try|catch|finally|lock|yield|await|when)\\b", "name": "keyword.control.cs" }, { "match": "\\b(from|where|select|group|into|orderby|join|let|on|equals|by|ascending|descending)\\b", "name": "keyword.linq.cs" }, { "match": "\\b(new|is|as|using|checked|unchecked|typeof|sizeof|override|readonly|stackalloc|nameof)\\b", "name": "keyword.operator.cs" }, { "match": "\\b(event|delegate|fixed|add|remove|set|get|value|alias|global)\\b", "name": "keyword.other.cs" }, { "match": "\\b(var)\\b", "name": "storage.type.var.cs" }, { "match": "[@]\\b(var|event|delegate|add|remove|set|get|value|new|is|as|using|checked|unchecked|typeof|sizeof |override|readonly|stackalloc|from|where|select|group|into|orderby|join|let|on|equals|by|ascending|descending |if|else|while|for|foreach|in|do|return|continue|break|switch|case|default|goto|throw|try|catch|finally|lock |yield|await|nameof|when|alias|global)\\b", "name": "meta.class.body.cs" } ] }, "method": { "patterns": [ { "begin": "\\[", "end": "\\]", "name": "meta.method.annotation.cs", "patterns": [ { "include": "#constants" }, { "include": "#preprocessor" }, { "include": "#builtinTypes" } ] }, { "begin": "(?=\\bnew\\s+)(?=[\\w<].*\\s+)(?=[^=]+\\()", "end": "(?={|;)", "name": "meta.new-object.cs", "patterns": [ { "include": "#code" } ] }, { "begin": "(?