{ "fileTypes": [ "ts" ], "name": "TypeScript", "patterns": [ { "include": "#expression" } ], "repository": { "access-modifier": { "match": "\\b(public|protected|private)\\b", "name": "storage.modifier.ts" }, "arithmetic-operator": { "match": "\\*|/|\\-\\-|\\-|\\+\\+|\\+|%", "name": "keyword.operator.arithmetic.ts" }, "array-literal": { "begin": "\\[", "beginCaptures": { "0": { "name": "meta.brace.square.ts" } }, "end": "\\]", "endCaptures": { "0": { "name": "meta.brace.square.ts" } }, "name": "meta.array.literal.ts", "patterns": [ { "include": "#expression" } ] }, "assignment-operator": { "match": "<<=|>>=|>>>=|\\*=|(?]))\\s*(<)(?!", "endCaptures": { "0": { "name": "meta.brace.angle.ts" } }, "name": "cast.expr.ts", "patterns": [ { "include": "#type" } ] }, "comment": { "name": "comment.ts", "patterns": [ { "include": "#comment-block-doc" }, { "include": "#comment-block" }, { "include": "#comment-line" } ] }, "comment-block": { "begin": "/\\*", "end": "\\*/", "name": "comment.block.ts" }, "comment-block-doc": { "begin": "/\\*\\*(?!/)", "end": "\\*/", "name": "comment.block.documentation.ts" }, "comment-line": { "match": "(//).*$\\n?", "name": "comment.line.ts" }, "control-statement": { "match": "(?|\\b(delete|export|import|in|instanceof|module|namespace|new|typeof|void)\\b", "name": "keyword.operator.ts" }, "field-declaration": { "begin": "(?=|<>|<|>", "name": "keyword.operator.comparison.ts" }, "return-type": { "begin": "(?<=\\))\\s*:", "end": "(?=$)|(?=\\{|;|//)", "name": "meta.return.type.ts", "patterns": [ { "include": "#type" } ] }, "static-modifier": { "match": "\\b(static)\\b", "name": "keyword.other.ts" }, "storage-keyword": { "match": "\\b(number|boolean|string|var|let|function|const)\\b", "name": "storage.type.ts" }, "string": { "name": "string.ts", "patterns": [ { "include": "#qstring-single" }, { "include": "#qstring-double" } ] }, "string-character-escape": { "match": "\\\\(x\\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)", "name": "constant.character.escape" }, "switch-case": { "begin": "(?])|(?<=[\\}>\\]\\)]|[a-zA-Z_$])\\s*(?=\\{)", "name": "meta.type.annotation.ts", "patterns": [ { "include": "#type" }, { "include": "#string" }, { "include": "#comment" } ] }, "type-declaration": { "begin": "\\b(type)\\b\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*", "beginCaptures": { "1": { "name": "keyword.other.ts" }, "2": { "name": "storage.type.ts" } }, "end": "(?=[,);>]|var|type|function|class|interface)", "name": "meta.type.declaration.ts", "patterns": [ { "include": "#type" } ] }, "type-function-return-type": { "begin": "=>", "beginCaptures": { "0": { "name": "keyword.operator.ts" } }, "end": "(?=\\s*[,\\)\\{=;>]|//|$)", "name": "meta.type.function.return.ts", "patterns": [ { "include": "#type" } ] }, "type-name": { "captures": { "1": { "name": "entity.name.type.ts" } }, "match": "[a-zA-Z_$][.\\w$]*", "name": "meta.type.name.ts" }, "type-object": { "begin": "\\{", "beginCaptures": { "0": { "name": "meta.brace.curly.ts" } }, "end": "\\}", "endCaptures": { "0": { "name": "meta.brace.curly.ts" } }, "name": "meta.object.type.ts", "patterns": [ { "include": "#comment" }, { "include": "#field-declaration" }, { "include": "#method-declaration" }, { "include": "#indexer-declaration" }, { "include": "#type-annotation" } ] }, "type-operator": { "match": "[.|]", "name": "keyword.operator.type.ts" }, "type-parameters": { "begin": "([a-zA-Z_$][\\w$]*)?(<)", "beginCaptures": { "1": { "name": "entity.name.type.ts" }, "2": { "name": "meta.brace.angle.ts" } }, "end": "(?=$)|(>)", "endCaptures": { "2": { "name": "meta.brace.angle.ts" } }, "name": "meta.type.parameters.ts", "patterns": [ { "match": "\\b(extends)\\b", "name": "keyword.other.ts" }, { "include": "#comment" }, { "include": "#type" } ] }, "type-paren-or-function-type-parameters": { "begin": "(?:\\b(new)\\b)?\\s*\\(", "beginCaptures": { "1": { "name": "keyword.control.ts" } }, "end": "\\)", "name": "meta.type.paren.cover.ts", "patterns": [ { "include": "#comment" }, { "include": "#type" }, { "include": "#function-type-parameters" } ] }, "type-primitive": { "captures": { "1": { "name": "storage.type.ts" } }, "match": "\\b(string|number|boolean|symbol|any|void)\\b", "name": "meta.type.primitive.ts" }, "type-tuple": { "begin": "\\[", "beginCaptures": { "0": { "name": "meta.brace.square.ts" } }, "end": "\\]", "endCaptures": { "0": { "name": "meta.brace.square.ts" } }, "name": "meta.type.tuple.ts", "patterns": [ { "include": "#type" }, { "include": "#comment" } ] }, "undefined-literal": { "match": "\\b(undefined)\\b", "name": "constant.language.ts" }, "var-expr": { "begin": "(?