{ "name": "TypeScriptReact", "scopeName": "source.tsx", "fileTypes": [ "tsx" ], "uuid": "805375ec-d614-41f5-8993-5843fe63ea82", "patterns": [ { "include": "#directives" }, { "include": "#statements" }, { "name": "comment.line.shebang.ts", "match": "\\A(#!).*(?=$)", "captures": { "1": { "name": "punctuation.definition.comment.ts" } } } ], "repository": { "statements": { "patterns": [ { "include": "#string" }, { "include": "#template" }, { "include": "#comment" }, { "include": "#declaration" }, { "include": "#switch-statement" }, { "include": "#for-loop" }, { "include": "#after-operator-block" }, { "include": "#decl-block" }, { "include": "#control-statement" }, { "include": "#expression" }, { "include": "#punctuation-semicolon" } ] }, "var-expr": { "name": "meta.var.expr.tsx", "begin": "(?) |\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>))\n ) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n )))\n )\n)", "beginCaptures": { "1": { "name": "meta.definition.variable.tsx entity.name.function.tsx" } }, "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" } ] }, { "name": "meta.var-single-variable.expr.tsx", "begin": "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])", "beginCaptures": { "1": { "name": "meta.definition.variable.tsx variable.other.constant.tsx" } }, "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" } ] }, { "name": "meta.var-single-variable.expr.tsx", "begin": "([_$[:alpha:]][_$[:alnum:]]*)", "beginCaptures": { "1": { "name": "meta.definition.variable.tsx variable.other.readwrite.tsx" } }, "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" } ] } ] }, "var-single-variable-type-annotation": { "patterns": [ { "include": "#type-annotation" }, { "include": "#string" }, { "include": "#comment" } ] }, "destructuring-variable": { "patterns": [ { "name": "meta.object-binding-pattern-variable.tsx", "begin": "(?) |\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>))\n ) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n )))\n )\n)" }, { "name": "meta.definition.property.tsx variable.object.property.tsx", "match": "[_$[:alpha:]][_$[:alnum:]]*" }, { "name": "keyword.operator.optional.tsx", "match": "\\?" } ] } ] }, "method-declaration": { "name": "meta.method.declaration.tsx", "begin": "(?) |\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>))\n ) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n )))\n )\n)", "captures": { "1": { "name": "storage.modifier.tsx" }, "2": { "name": "keyword.operator.rest.tsx" }, "3": { "name": "entity.name.function.tsx" }, "4": { "name": "keyword.operator.optional.tsx" } } }, { "match": "(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?])|(?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)", "patterns": [ { "include": "#comment" }, { "include": "#type" } ] }, "type": { "patterns": [ { "include": "#comment" }, { "include": "#string" }, { "include": "#numeric-literal" }, { "include": "#type-primitive" }, { "include": "#type-builtin-literals" }, { "include": "#type-parameters" }, { "include": "#type-tuple" }, { "include": "#type-object" }, { "include": "#type-operators" }, { "include": "#type-fn-type-parameters" }, { "include": "#type-paren-or-function-parameters" }, { "include": "#type-function-return-type" }, { "include": "#type-name" } ] }, "function-parameters": { "name": "meta.parameters.tsx", "begin": "\\(", "beginCaptures": { "0": { "name": "punctuation.definition.parameters.begin.tsx" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.parameters.end.tsx" } }, "patterns": [ { "include": "#comment" }, { "include": "#decorator" }, { "include": "#destructuring-parameter" }, { "include": "#parameter-name" }, { "include": "#type-annotation" }, { "include": "#variable-initializer" }, { "name": "punctuation.separator.parameter.tsx", "match": "," } ] }, "type-primitive": { "name": "support.type.primitive.tsx", "match": "(?)\n ))\n )\n )\n)", "end": "(?<=\\))", "patterns": [ { "include": "#function-parameters" } ] } ] }, "type-operators": { "patterns": [ { "include": "#typeof-operator" }, { "name": "keyword.operator.type.tsx", "match": "[&|]" }, { "name": "keyword.operator.expression.keyof.tsx", "match": "(?", "beginCaptures": { "0": { "name": "storage.type.function.arrow.tsx" } }, "end": "(?)(?=[,\\]\\)\\{\\}=;>]|//|$)", "patterns": [ { "include": "#comment" }, { "name": "meta.object.type.tsx", "begin": "(?<==>)\\s*(\\{)", "beginCaptures": { "1": { "name": "punctuation.definition.block.tsx" } }, "end": "\\}", "endCaptures": { "0": { "name": "punctuation.definition.block.tsx" } }, "patterns": [ { "include": "#type-object-members" } ] }, { "include": "#type-predicate-operator" }, { "include": "#type" } ] }, "type-tuple": { "name": "meta.type.tuple.tsx", "begin": "\\[", "beginCaptures": { "0": { "name": "meta.brace.square.tsx" } }, "end": "\\]", "endCaptures": { "0": { "name": "meta.brace.square.tsx" } }, "patterns": [ { "include": "#type" }, { "include": "#punctuation-comma" } ] }, "type-name": { "patterns": [ { "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\.)", "captures": { "1": { "name": "entity.name.type.module.tsx" }, "2": { "name": "punctuation.accessor.tsx" } } }, { "name": "entity.name.type.tsx", "match": "[_$[:alpha:]][_$[:alnum:]]*" } ] }, "type-parameters": { "name": "meta.type.parameters.tsx", "begin": "(<)", "beginCaptures": { "1": { "name": "punctuation.definition.typeparameters.begin.tsx" } }, "end": "(?=$)|(>)", "endCaptures": { "1": { "name": "punctuation.definition.typeparameters.end.tsx" } }, "patterns": [ { "include": "#comment" }, { "name": "storage.modifier.tsx", "match": "(?)" }, { "include": "#type" }, { "include": "#punctuation-comma" } ] }, "variable-initializer": { "patterns": [ { "begin": "(?]|\\<[^<>]+\\>)+>\\s*)?\\()", "captures": { "1": { "name": "punctuation.accessor.tsx" }, "2": { "name": "support.constant.dom.tsx" }, "3": { "name": "support.variable.property.dom.tsx" } } }, { "name": "support.class.node.tsx", "match": "(?x)(?]|\\<[^<>]+\\>)+>\\s*)?\\()", "end": "(?<=\\))(?!(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()", "patterns": [ { "include": "#literal" }, { "include": "#support-objects" }, { "include": "#object-identifiers" }, { "include": "#punctuation-accessor" }, { "name": "entity.name.function.tsx", "match": "([_$[:alpha:]][_$[:alnum:]]*)" }, { "include": "#comment" }, { "name": "meta.type.parameters.tsx", "begin": "\\<", "beginCaptures": { "0": { "name": "punctuation.definition.typeparameters.begin.tsx" } }, "end": "\\>", "endCaptures": { "0": { "name": "punctuation.definition.typeparameters.end.tsx" } }, "patterns": [ { "include": "#type" }, { "include": "#punctuation-comma" } ] }, { "include": "#paren-expression" } ] }, "identifiers": { "patterns": [ { "include": "#object-identifiers" }, { "match": "(?x)(?:(\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n (async\\s+)|(function\\s*[(<])|(function\\s+)|\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)|\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)))", "captures": { "1": { "name": "punctuation.accessor.tsx" }, "2": { "name": "entity.name.function.tsx" } } }, { "match": "(\\.)\\s*([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])", "captures": { "1": { "name": "punctuation.accessor.tsx" }, "2": { "name": "variable.other.constant.property.tsx" } } }, { "match": "(\\.)\\s*([_$[:alpha:]][_$[:alnum:]]*)", "captures": { "1": { "name": "punctuation.accessor.tsx" }, "2": { "name": "variable.other.property.tsx" } } }, { "name": "variable.other.constant.tsx", "match": "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])" }, { "name": "variable.other.readwrite.tsx", "match": "[_$[:alpha:]][_$[:alnum:]]*" } ] }, "object-identifiers": { "patterns": [ { "name": "support.class.tsx", "match": "([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\.\\s*prototype\\b(?!\\$))" }, { "match": "(?x)(\\.)\\s*(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)", "captures": { "1": { "name": "punctuation.accessor.tsx" }, "2": { "name": "variable.other.constant.object.property.tsx" }, "3": { "name": "variable.other.object.property.tsx" } } }, { "match": "(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)", "captures": { "1": { "name": "variable.other.constant.object.tsx" }, "2": { "name": "variable.other.object.tsx" } } } ] }, "cast": { "patterns": [ { "include": "#jsx" } ] }, "new-expr": { "name": "new.expr.tsx", "begin": "(?)|\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>))))", "beginCaptures": { "0": { "name": "meta.object-literal.key.tsx" }, "1": { "name": "entity.name.function.tsx" }, "2": { "name": "punctuation.separator.key-value.tsx" } }, "end": "(?=,|\\})", "patterns": [ { "include": "#expression" } ] }, { "name": "meta.object.member.tsx", "begin": "(?:[_$[:alpha:]][_$[:alnum:]]*)\\s*(:)", "beginCaptures": { "0": { "name": "meta.object-literal.key.tsx" }, "1": { "name": "punctuation.separator.key-value.tsx" } }, "end": "(?=,|\\})", "patterns": [ { "include": "#expression" } ] }, { "name": "meta.object.member.tsx", "begin": "\\.\\.\\.", "beginCaptures": { "0": { "name": "keyword.operator.spread.tsx" } }, "end": "(?=,|\\})", "patterns": [ { "include": "#expression" } ] }, { "name": "meta.object.member.tsx", "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=,|\\}|$)", "captures": { "1": { "name": "variable.other.readwrite.tsx" } } }, { "include": "#punctuation-comma" } ] }, "expression-operators": { "patterns": [ { "name": "keyword.control.flow.tsx", "match": "(?>=|>>>=|\\|=" }, { "name": "keyword.operator.bitwise.shift.tsx", "match": "<<|>>>|>>" }, { "name": "keyword.operator.comparison.tsx", "match": "===|!==|==|!=" }, { "name": "keyword.operator.relational.tsx", "match": "<=|>=|<>|<|>" }, { "name": "keyword.operator.logical.tsx", "match": "\\!|&&|\\|\\|" }, { "name": "keyword.operator.bitwise.tsx", "match": "\\&|~|\\^|\\|" }, { "name": "keyword.operator.assignment.tsx", "match": "\\=" }, { "name": "keyword.operator.decrement.tsx", "match": "--" }, { "name": "keyword.operator.increment.tsx", "match": "\\+\\+" }, { "name": "keyword.operator.arithmetic.tsx", "match": "%|\\*|/|-|\\+" }, { "match": "(?<=[_$[:alnum:])])\\s*(/)(?![/*])", "captures": { "1": { "name": "keyword.operator.arithmetic.tsx" } } } ] }, "typeof-operator": { "name": "keyword.operator.expression.typeof.tsx", "match": "(?)", "captures": { "1": { "name": "storage.modifier.async.tsx" }, "2": { "name": "variable.parameter.tsx" } } }, { "name": "meta.arrow.tsx", "begin": "(?x) (?:\n (? is on new line\n (\n [(]\\s*\n (\n ([)]\\s*:) | # ():\n ([_$[:alpha:]][_$[:alnum:]]*\\s*:) | # [(]param:\n (\\.\\.\\.) # [(]...\n )\n ) |\n (\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends \n ) |\n # arrow function possible to detect only with => on same line\n (\n (<([^<>]|\\<[^<>]+\\>)+>\\s*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)", "beginCaptures": { "1": { "name": "storage.modifier.async.tsx" } }, "end": "(?==>|\\{)", "patterns": [ { "include": "#comment" }, { "include": "#type-parameters" }, { "include": "#function-parameters" }, { "include": "#arrow-return-type" } ] }, { "name": "meta.arrow.tsx", "begin": "=>", "beginCaptures": { "0": { "name": "storage.type.function.arrow.tsx" } }, "end": "(?<=\\})|((?!\\{)(?=\\S))", "patterns": [ { "include": "#decl-block" }, { "include": "#expression" } ] } ] }, "arrow-return-type": { "name": "meta.return.type.arrow.tsx", "begin": "(?<=\\))\\s*(:)", "beginCaptures": { "1": { "name": "keyword.operator.type.annotation.tsx" } }, "end": "(?==>|\\{)", "patterns": [ { "name": "meta.object.type.tsx", "begin": "(?<=:)\\s*(\\{)", "beginCaptures": { "1": { "name": "punctuation.definition.block.tsx" } }, "end": "\\}", "endCaptures": { "0": { "name": "punctuation.definition.block.tsx" } }, "patterns": [ { "include": "#type-object-members" } ] }, { "include": "#type-predicate-operator" }, { "include": "#type" } ] }, "punctuation-comma": { "name": "punctuation.separator.comma.tsx", "match": "," }, "punctuation-semicolon": { "name": "punctuation.terminator.statement.tsx", "match": ";" }, "punctuation-accessor": { "name": "punctuation.accessor.tsx", "match": "\\." }, "paren-expression": { "begin": "\\(", "beginCaptures": { "0": { "name": "meta.brace.round.tsx" } }, "end": "\\)", "endCaptures": { "0": { "name": "meta.brace.round.tsx" } }, "patterns": [ { "include": "#expression" }, { "include": "#punctuation-comma" } ] }, "qstring-double": { "name": "string.quoted.double.tsx", "begin": "\"", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.tsx" } }, "end": "(\")|((?:[^\\\\\\n])$)", "endCaptures": { "1": { "name": "punctuation.definition.string.end.tsx" }, "2": { "name": "invalid.illegal.newline.tsx" } }, "patterns": [ { "include": "#string-character-escape" } ] }, "qstring-single": { "name": "string.quoted.single.tsx", "begin": "'", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.tsx" } }, "end": "(\\')|((?:[^\\\\\\n])$)", "endCaptures": { "1": { "name": "punctuation.definition.string.end.tsx" }, "2": { "name": "invalid.illegal.newline.tsx" } }, "patterns": [ { "include": "#string-character-escape" } ] }, "regex": { "patterns": [ { "name": "string.regexp.tsx", "begin": "(?<=[=(:,\\[?+!]|return|case|=>|&&|\\|\\||\\*\\/)\\s*(/)(?![/*])(?=(?:[^/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+/(?![/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))", "beginCaptures": { "1": { "name": "punctuation.definition.string.begin.tsx" } }, "end": "(/)([gimuy]*)", "endCaptures": { "1": { "name": "punctuation.definition.string.end.tsx" }, "2": { "name": "keyword.other.tsx" } }, "patterns": [ { "include": "#regexp" } ] }, { "name": "string.regexp.tsx", "begin": "(?\\s*$)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.tsx" } }, "end": "(?=$)", "patterns": [ { "name": "meta.tag.tsx", "begin": "(<)(reference|amd-dependency|amd-module)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.directive.tsx" }, "2": { "name": "entity.name.tag.directive.tsx" } }, "end": "/>", "endCaptures": { "0": { "name": "punctuation.definition.tag.directive.tsx" } }, "patterns": [ { "name": "entity.other.attribute-name.directive.tsx", "match": "path|types|no-default-lib|name" }, { "name": "keyword.operator.assignment.tsx", "match": "=" }, { "include": "#string" } ] } ] }, "docblock": { "patterns": [ { "name": "storage.type.class.jsdoc", "match": "(?x)(? # {Array} or {Object} type application (optional .)\n )\n (?:\n [\\.|~] # {Foo.bar} namespaced, {string|number} multiple, {Foo~bar} class-specific callback\n [a-zA-Z_$]+\n (?:\n (?:\n [\\w$]*\n (?:\\[\\])? # {(string|number[])} type application, a string or an array of numbers\n ) |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array} or {Object} type application (optional .)\n )\n )*\n \\) |\n [a-zA-Z_$]+\n (?:\n (?:\n [\\w$]*\n (?:\\[\\])? # {(string|number[])} type application, a string or an array of numbers\n ) |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array} or {Object} type application (optional .)\n )\n (?:\n [\\.|~] # {Foo.bar} namespaced, {string|number} multiple, {Foo~bar} class-specific callback\n [a-zA-Z_$]+\n (?:\n [\\w$]* |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array} or {Object} type application (optional .)\n )\n )*\n )\n )\n # Check for suffix\n (?:\\[\\])? # {string[]} type application, an array of strings\n =? # {string=} optional parameter\n )\n)})\n\n\\s+\n\n(\n \\[ # [foo] optional parameter\n \\s*\n (?:\n [a-zA-Z_$][\\w$]*\n (?:\n (?:\\[\\])? # Foo[].bar properties within an array\n \\. # Foo.Bar namespaced parameter\n [a-zA-Z_$][\\w$]*\n )*\n (?:\n \\s*\n = # [foo=bar] Default parameter value\n \\s*\n [\\w$\\s]*\n )?\n )\n \\s*\n \\] |\n (?:\n [a-zA-Z_$][\\w$]*\n (?:\n (?:\\[\\])? # Foo[].bar properties within an array\n \\. # Foo.Bar namespaced parameter\n [a-zA-Z_$][\\w$]*\n )*\n )?\n)\n\n\\s+\n\n(?:-\\s+)? # optional hyphen before the description\n\n((?:(?!\\*\\/).)*) # The type description", "captures": { "0": { "name": "other.meta.jsdoc" }, "1": { "name": "entity.name.type.instance.jsdoc" }, "2": { "name": "variable.other.jsdoc" }, "3": { "name": "other.description.jsdoc" } } }, { "match": "(?x)\n\n({(?:\n \\* | # {*} any type\n \\? | # {?} unknown type\n\n (?:\n (?: # Check for a prefix\n \\? | # {?string} nullable type\n ! | # {!string} non-nullable type\n \\.{3} # {...string} variable number of parameters\n )?\n\n (?:\n (?:\n function # {function(string, number)} function type\n \\s*\n \\(\n \\s*\n (?:\n [a-zA-Z_$][\\w$]*\n (?:\n \\s*,\\s*\n [a-zA-Z_$][\\w$]*\n )*\n )?\n \\s*\n \\)\n (?: # {function(): string} function return type\n \\s*:\\s*\n [a-zA-Z_$][\\w$]*\n )?\n )?\n |\n (?:\n \\( # Opening bracket of multiple types with parenthesis {(string|number)}\n [a-zA-Z_$]+\n (?:\n [\\w$]* |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array} or {Object} type application (optional .)\n )\n (?:\n [\\.|~] # {Foo.bar} namespaced, {string|number} multiple, {Foo~bar} class-specific callback\n [a-zA-Z_$]+\n (?:\n [\\w$]* |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array} or {Object} type application (optional .)\n )\n )*\n \\) |\n [a-zA-Z_$]+\n (?:\n [\\w$]* |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array} or {Object} type application (optional .)\n )\n (?:\n [\\.|~] # {Foo.bar} namespaced, {string|number} multiple, {Foo~bar} class-specific callback\n [a-zA-Z_$]+\n (?:\n [\\w$]* |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array} or {Object} type application (optional .)\n )\n )*\n )\n )\n # Check for suffix\n (?:\\[\\])? # {string[]} type application, an array of strings\n =? # {string=} optional parameter\n )\n)})\n\n\\s+\n\n(?:-\\s+)? # optional hyphen before the description\n\n((?:(?!\\*\\/).)*) # The type description", "captures": { "0": { "name": "other.meta.jsdoc" }, "1": { "name": "entity.name.type.instance.jsdoc" }, "2": { "name": "other.description.jsdoc" } } } ] }, "jsx-tag-attributes": { "patterns": [ { "include": "#jsx-tag-attribute-name" }, { "include": "#jsx-tag-attribute-assignment" }, { "include": "#jsx-string-double-quoted" }, { "include": "#jsx-string-single-quoted" }, { "include": "#jsx-evaluated-code" } ] }, "jsx-tag-attribute-name": { "match": "(?x)\n \\s*\n ([_$a-zA-Z][-$\\w]*)\n (?=\\s|=|/?>|/\\*|//)", "captures": { "1": { "name": "entity.other.attribute-name.tsx" } } }, "jsx-tag-attribute-assignment": { "name": "keyword.operator.assignment.tsx", "match": "=(?=\\s*(?:'|\"|{|/\\*|//|\\n))" }, "jsx-string-double-quoted": { "name": "string.quoted.double.tsx", "begin": "\"", "end": "\"", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.tsx" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.tsx" } }, "patterns": [ { "include": "#jsx-entities" } ] }, "jsx-string-single-quoted": { "name": "string.quoted.single.tsx", "begin": "'", "end": "'", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.tsx" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.tsx" } }, "patterns": [ { "include": "#jsx-entities" } ] }, "jsx-entities": { "patterns": [ { "name": "constant.character.entity.tsx", "match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)", "captures": { "1": { "name": "punctuation.definition.entity.tsx" }, "3": { "name": "punctuation.definition.entity.tsx" } } }, { "name": "invalid.illegal.bad-ampersand.tsx", "match": "&" } ] }, "jsx-evaluated-code": { "name": "meta.embedded.expression.tsx", "begin": "\\{", "end": "\\}", "beginCaptures": { "0": { "name": "punctuation.section.embedded.begin.tsx" } }, "endCaptures": { "0": { "name": "punctuation.section.embedded.end.tsx" } }, "patterns": [ { "include": "#expression" } ] }, "jsx-tag-attributes-illegal": { "name": "invalid.illegal.attribute.tsx", "match": "\\S+" }, "jsx-tag-without-attributes": { "name": "meta.tag.without-attributes.tsx", "begin": "(<)\\s*([_$a-zA-Z][-$\\w.]*(?)", "end": "()", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.tsx" }, "2": { "name": "entity.name.tag.tsx" }, "3": { "name": "punctuation.definition.tag.end.tsx" } }, "endCaptures": { "1": { "name": "punctuation.definition.tag.begin.tsx" }, "2": { "name": "entity.name.tag.tsx" }, "3": { "name": "punctuation.definition.tag.end.tsx" } }, "contentName": "meta.jsx.children.tsx", "patterns": [ { "include": "#jsx-children" } ] }, "jsx-tag-in-expression": { "begin": "(?x)\n (?<=[({\\[,?=>:*]|&&|\\|\\||\\?|\\Wreturn|^return|\\Wdefault|^)\\s*\n (?!(<)\\s*([_$a-zA-Z][-$\\w.]*(?)) #look ahead is not start of tag without attributes\n (?!<\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s+[^=>])|,)) # look ahead is not type parameter of arrow\n (?=(<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?))", "end": "(/>)|(?:())", "endCaptures": { "0": { "name": "meta.tag.tsx" }, "1": { "name": "punctuation.definition.tag.end.tsx" }, "2": { "name": "punctuation.definition.tag.begin.tsx" }, "3": { "name": "entity.name.tag.tsx" }, "4": { "name": "punctuation.definition.tag.end.tsx" } }, "patterns": [ { "include": "#jsx-tag" } ] }, "jsx-child-tag": { "begin": "(?x)\n (?=(<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?))", "end": "(/>)|(?:())", "endCaptures": { "0": { "name": "meta.tag.tsx" }, "1": { "name": "punctuation.definition.tag.end.tsx" }, "2": { "name": "punctuation.definition.tag.begin.tsx" }, "3": { "name": "entity.name.tag.tsx" }, "4": { "name": "punctuation.definition.tag.end.tsx" } }, "patterns": [ { "include": "#jsx-tag" } ] }, "jsx-tag": { "name": "meta.tag.tsx", "begin": "(?x)\n (?=(<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?))", "end": "(?=(/>)|(?:()))", "patterns": [ { "begin": "(?x)\n (<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.tsx" }, "2": { "name": "entity.name.tag.tsx" } }, "end": "(?=[/]?>)", "patterns": [ { "include": "#comment" }, { "include": "#jsx-tag-attributes" }, { "include": "#jsx-tag-attributes-illegal" } ] }, { "begin": "(>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.end.tsx" } }, "end": "(?=" }, "jsx-children": { "patterns": [ { "include": "#jsx-tag-without-attributes" }, { "include": "#jsx-child-tag" }, { "include": "#jsx-tag-invalid" }, { "include": "#jsx-evaluated-code" }, { "include": "#jsx-entities" } ] }, "jsx": { "patterns": [ { "include": "#jsx-tag-without-attributes" }, { "include": "#jsx-tag-in-expression" }, { "include": "#jsx-tag-invalid" } ] } } }