{ "name": "JavaScript (with React support)", "scopeName": "source.js", "fileTypes": [ ".js", ".jsx", ".es6", ".mjs" ], "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.js", "begin": "(?)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)", "beginCaptures": { "1": { "name": "meta.definition.variable.js entity.name.function.js" } }, "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" } ] }, { "name": "meta.var-single-variable.expr.js", "begin": "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])", "beginCaptures": { "1": { "name": "meta.definition.variable.js variable.other.constant.js" } }, "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" } ] }, { "name": "meta.var-single-variable.expr.js", "begin": "([_$[:alpha:]][_$[:alnum:]]*)", "beginCaptures": { "1": { "name": "meta.definition.variable.js variable.other.readwrite.js" } }, "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.js", "begin": "(?)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)" }, { "name": "meta.definition.property.js variable.object.property.js", "match": "[_$[:alpha:]][_$[:alnum:]]*" }, { "name": "keyword.operator.optional.js", "match": "\\?" } ] } ] }, "method-declaration": { "patterns": [ { "name": "meta.method.declaration.js", "begin": "(?)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)", "captures": { "1": { "name": "storage.modifier.js" }, "2": { "name": "keyword.operator.rest.js" }, "3": { "name": "entity.name.function.js" }, "4": { "name": "keyword.operator.optional.js" } } }, { "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.js", "begin": "\\(", "beginCaptures": { "0": { "name": "punctuation.definition.parameters.begin.js" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.parameters.end.js" } }, "patterns": [ { "include": "#comment" }, { "include": "#decorator" }, { "include": "#destructuring-parameter" }, { "include": "#parameter-name" }, { "include": "#type-annotation" }, { "include": "#variable-initializer" }, { "name": "punctuation.separator.parameter.js", "match": "," } ] }, "type-primitive": { "name": "support.type.primitive.js", "match": "(?)\n ))\n )\n )\n)", "end": "(?<=\\))", "patterns": [ { "include": "#function-parameters" } ] } ] }, "type-operators": { "patterns": [ { "include": "#typeof-operator" }, { "begin": "([&|])(?=\\s*\\{)", "beginCaptures": { "0": { "name": "keyword.operator.type.js" } }, "end": "(?<=\\})", "patterns": [ { "include": "#type-object" } ] }, { "begin": "[&|]", "beginCaptures": { "0": { "name": "keyword.operator.type.js" } }, "end": "(?=\\S)" }, { "name": "keyword.operator.expression.keyof.js", "match": "(?", "beginCaptures": { "0": { "name": "storage.type.function.arrow.js" } }, "end": "(?)(?]|//|$)", "patterns": [ { "include": "#comment" }, { "begin": "(?<==>)(?=\\s*\\{)", "end": "(?<=\\})", "patterns": [ { "include": "#type-object" } ] }, { "include": "#type-predicate-operator" }, { "include": "#type" } ] }, "type-tuple": { "name": "meta.type.tuple.js", "begin": "\\[", "beginCaptures": { "0": { "name": "meta.brace.square.js" } }, "end": "\\]", "endCaptures": { "0": { "name": "meta.brace.square.js" } }, "patterns": [ { "include": "#type" }, { "include": "#punctuation-comma" } ] }, "type-name": { "patterns": [ { "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\.)", "captures": { "1": { "name": "entity.name.type.module.js" }, "2": { "name": "punctuation.accessor.js" } } }, { "name": "entity.name.type.js", "match": "[_$[:alpha:]][_$[:alnum:]]*" } ] }, "type-parameters": { "name": "meta.type.parameters.js", "begin": "(<)", "beginCaptures": { "1": { "name": "punctuation.definition.typeparameters.begin.js" } }, "end": "(>)", "endCaptures": { "1": { "name": "punctuation.definition.typeparameters.end.js" } }, "patterns": [ { "include": "#comment" }, { "name": "storage.modifier.js", "match": "(?)" }, { "include": "#type" }, { "include": "#punctuation-comma" } ] }, "variable-initializer": { "patterns": [ { "begin": "(?=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\()", "captures": { "1": { "name": "punctuation.accessor.js" }, "2": { "name": "support.constant.dom.js" }, "3": { "name": "support.variable.property.dom.js" } } }, { "name": "support.class.node.js", "match": "(?x)(?=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\()", "end": "(?<=\\))(?!(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\()", "patterns": [ { "name": "meta.function-call.js", "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))", "end": "(?=\\s*(<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\()", "patterns": [ { "include": "#literal" }, { "include": "#support-objects" }, { "include": "#object-identifiers" }, { "include": "#punctuation-accessor" }, { "name": "entity.name.function.js", "match": "([_$[:alpha:]][_$[:alnum:]]*)" } ] }, { "include": "#comment" }, { "name": "meta.type.parameters.js", "begin": "\\<", "beginCaptures": { "0": { "name": "punctuation.definition.typeparameters.begin.js" } }, "end": "\\>", "endCaptures": { "0": { "name": "punctuation.definition.typeparameters.end.js" } }, "patterns": [ { "include": "#type" }, { "include": "#punctuation-comma" } ] }, { "include": "#paren-expression" } ] }, "identifiers": { "patterns": [ { "include": "#object-identifiers" }, { "match": "(?x)(?:(\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n ((async\\s+)?(\n (function\\s*[(<]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n))", "captures": { "1": { "name": "punctuation.accessor.js" }, "2": { "name": "entity.name.function.js" } } }, { "match": "(\\.)\\s*([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])", "captures": { "1": { "name": "punctuation.accessor.js" }, "2": { "name": "variable.other.constant.property.js" } } }, { "match": "(\\.)\\s*([_$[:alpha:]][_$[:alnum:]]*)", "captures": { "1": { "name": "punctuation.accessor.js" }, "2": { "name": "variable.other.property.js" } } }, { "name": "variable.other.constant.js", "match": "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])" }, { "name": "variable.other.readwrite.js", "match": "[_$[:alpha:]][_$[:alnum:]]*" } ] }, "object-identifiers": { "patterns": [ { "name": "support.class.js", "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.js" }, "2": { "name": "variable.other.constant.object.property.js" }, "3": { "name": "variable.other.object.property.js" } } }, { "match": "(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)", "captures": { "1": { "name": "variable.other.constant.object.js" }, "2": { "name": "variable.other.object.js" } } } ] }, "cast": { "patterns": [ { "include": "#jsx" } ] }, "new-expr": { "name": "new.expr.js", "begin": "(?)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n)))", "beginCaptures": { "0": { "name": "meta.object-literal.key.js" }, "1": { "name": "entity.name.function.js" }, "2": { "name": "punctuation.separator.key-value.js" } }, "end": "(?=,|\\})", "patterns": [ { "include": "#expression" } ] }, { "name": "meta.object.member.js", "begin": "(?:[_$[:alpha:]][_$[:alnum:]]*)\\s*(:)", "beginCaptures": { "0": { "name": "meta.object-literal.key.js" }, "1": { "name": "punctuation.separator.key-value.js" } }, "end": "(?=,|\\})", "patterns": [ { "include": "#expression" } ] }, { "name": "meta.object.member.js", "begin": "\\.\\.\\.", "beginCaptures": { "0": { "name": "keyword.operator.spread.js" } }, "end": "(?=,|\\})", "patterns": [ { "include": "#expression" } ] }, { "name": "meta.object.member.js", "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=,|\\}|$)", "captures": { "1": { "name": "variable.other.readwrite.js" } } }, { "include": "#punctuation-comma" } ] }, "expression-operators": { "patterns": [ { "name": "keyword.control.flow.js", "match": "(?>=|>>>=|\\|=" }, { "name": "keyword.operator.bitwise.shift.js", "match": "<<|>>>|>>" }, { "name": "keyword.operator.comparison.js", "match": "===|!==|==|!=" }, { "name": "keyword.operator.relational.js", "match": "<=|>=|<>|<|>" }, { "name": "keyword.operator.logical.js", "match": "\\!|&&|\\|\\|" }, { "name": "keyword.operator.bitwise.js", "match": "\\&|~|\\^|\\|" }, { "name": "keyword.operator.assignment.js", "match": "\\=" }, { "name": "keyword.operator.decrement.js", "match": "--" }, { "name": "keyword.operator.increment.js", "match": "\\+\\+" }, { "name": "keyword.operator.arithmetic.js", "match": "%|\\*|/|-|\\+" }, { "match": "(?<=[_$[:alnum:])])\\s*(/)(?![/*])", "captures": { "1": { "name": "keyword.operator.arithmetic.js" } } } ] }, "typeof-operator": { "name": "keyword.operator.expression.typeof.js", "match": "(?)", "captures": { "1": { "name": "storage.modifier.async.js" }, "2": { "name": "variable.parameter.js" } } }, { "name": "meta.arrow.js", "begin": "(?x) (?:\n (? is on new line\n (\n [(]\\s*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\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.js" } }, "end": "(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))", "patterns": [ { "include": "#comment" }, { "include": "#type-parameters" }, { "include": "#function-parameters" }, { "include": "#arrow-return-type" } ] }, { "name": "meta.arrow.js", "begin": "=>", "beginCaptures": { "0": { "name": "storage.type.function.arrow.js" } }, "end": "(?<=\\})|((?!\\{)(?=\\S))", "patterns": [ { "include": "#decl-block" }, { "include": "#expression" } ] } ] }, "arrow-return-type": { "name": "meta.return.type.arrow.js", "begin": "(?<=\\))\\s*(:)", "beginCaptures": { "1": { "name": "keyword.operator.type.annotation.js" } }, "end": "(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))", "patterns": [ { "begin": "(?<=[:])(?=\\s*\\{)", "end": "(?<=\\})", "patterns": [ { "include": "#type-object" } ] }, { "include": "#type-predicate-operator" }, { "include": "#type" } ] }, "punctuation-comma": { "name": "punctuation.separator.comma.js", "match": "," }, "punctuation-semicolon": { "name": "punctuation.terminator.statement.js", "match": ";" }, "punctuation-accessor": { "name": "punctuation.accessor.js", "match": "\\." }, "paren-expression": { "begin": "\\(", "beginCaptures": { "0": { "name": "meta.brace.round.js" } }, "end": "\\)", "endCaptures": { "0": { "name": "meta.brace.round.js" } }, "patterns": [ { "include": "#expression" }, { "include": "#punctuation-comma" } ] }, "qstring-double": { "name": "string.quoted.double.js", "begin": "\"", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.js" } }, "end": "(\")|((?:[^\\\\\\n])$)", "endCaptures": { "1": { "name": "punctuation.definition.string.end.js" }, "2": { "name": "invalid.illegal.newline.js" } }, "patterns": [ { "include": "#string-character-escape" } ] }, "qstring-single": { "name": "string.quoted.single.js", "begin": "'", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.js" } }, "end": "(\\')|((?:[^\\\\\\n])$)", "endCaptures": { "1": { "name": "punctuation.definition.string.end.js" }, "2": { "name": "invalid.illegal.newline.js" } }, "patterns": [ { "include": "#string-character-escape" } ] }, "regex": { "patterns": [ { "name": "string.regexp.js", "begin": "(?<=[=(:,\\[?+!]|return|case|=>|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+\\/(?![\\/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))", "beginCaptures": { "1": { "name": "punctuation.definition.string.begin.js" } }, "end": "(/)([gimuy]*)", "endCaptures": { "1": { "name": "punctuation.definition.string.end.js" }, "2": { "name": "keyword.other.js" } }, "patterns": [ { "include": "#regexp" } ] }, { "name": "string.regexp.js", "begin": "(?\\s*$)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.js" } }, "end": "(?=^)", "patterns": [ { "name": "meta.tag.js", "begin": "(<)(reference|amd-dependency|amd-module)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.directive.js" }, "2": { "name": "entity.name.tag.directive.js" } }, "end": "/>", "endCaptures": { "0": { "name": "punctuation.definition.tag.directive.js" } }, "patterns": [ { "name": "entity.other.attribute-name.directive.js", "match": "path|types|no-default-lib|name" }, { "name": "keyword.operator.assignment.js", "match": "=" }, { "include": "#string" } ] } ] }, "docblock": { "patterns": [ { "match": "(?x)\n((@)access)\n\\s+\n(private|protected|public)\n\\b", "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "constant.language.access-type.jsdoc" } } }, { "match": "(?x)\n((@)author)\n\\s+\n(\n [^@\\s<>*/]\n (?:[^@<>*/]|\\*[^/])*\n)\n(?:\n \\s*\n (<)\n ([^>\\s]+)\n (>)\n)?", "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "entity.name.type.instance.jsdoc" }, "4": { "name": "punctuation.definition.bracket.angle.begin.jsdoc" }, "5": { "name": "constant.other.email.link.underline.jsdoc" }, "6": { "name": "punctuation.definition.bracket.angle.end.jsdoc" } } }, { "match": "(?x)\n((@)borrows) \\s+\n((?:[^@\\s*/]|\\*[^/])+) # \n\\s+ (as) \\s+ # as\n((?:[^@\\s*/]|\\*[^/])+) # ", "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "entity.name.type.instance.jsdoc" }, "4": { "name": "keyword.operator.control.jsdoc" }, "5": { "name": "entity.name.type.instance.jsdoc" } } }, { "name": "meta.example.jsdoc", "begin": "((@)example)\\s+", "end": "(?=@|\\*/)", "beginCaptures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" } }, "patterns": [ { "match": "^\\s\\*\\s+" }, { "contentName": "constant.other.description.jsdoc", "begin": "\\G(<)caption(>)", "beginCaptures": { "0": { "name": "entity.name.tag.inline.jsdoc" }, "1": { "name": "punctuation.definition.bracket.angle.begin.jsdoc" }, "2": { "name": "punctuation.definition.bracket.angle.end.jsdoc" } }, "end": "()|(?=\\*/)", "endCaptures": { "0": { "name": "entity.name.tag.inline.jsdoc" }, "1": { "name": "punctuation.definition.bracket.angle.begin.jsdoc" }, "2": { "name": "punctuation.definition.bracket.angle.end.jsdoc" } } }, { "match": "[^\\s@*](?:[^*]|\\*[^/])*", "captures": { "0": { "name": "source.embedded.js" } } } ] }, { "match": "(?x) ((@)kind) \\s+ (class|constant|event|external|file|function|member|mixin|module|namespace|typedef) \\b", "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "constant.language.symbol-type.jsdoc" } } }, { "match": "(?x)\n((@)see)\n\\s+\n(?:\n # URL\n (\n (?=https?://)\n (?:[^\\s*]|\\*[^/])+\n )\n |\n # JSDoc namepath\n (\n (?!https?://)\n (?:[^@\\s*/]|\\*[^/])+\n )\n)", "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "variable.other.link.underline.jsdoc" }, "4": { "name": "entity.name.type.instance.jsdoc" } } }, { "match": "(?x)\n((@)template)\n\\s+\n# One or more valid identifiers\n(?:\n ([A-Za-z_$] # First character: non-numeric word character\n [\\w$.\\[\\]]*) # Rest of identifier\n (?: # Possible list of additional identifiers\n \\s* (,) \\s*\n ([A-Za-z_$]\n [\\w$.\\[\\]]*)\n )*\n)", "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "variable.other.jsdoc" }, "4": { "name": "punctuation.delimiter.object.comma.jsdoc" }, "5": { "name": "variable.other.jsdoc" } } }, { "match": "(?x)\n(\n (@)\n (?:arg|argument|const|constant|member|namespace|param|var)\n)\n\\s+\n(\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n)", "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "variable.other.jsdoc" } } }, { "begin": "((@)typedef)\\s+(?={)", "beginCaptures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" } }, "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])", "patterns": [ { "include": "#jsdoctype" }, { "name": "entity.name.type.instance.jsdoc", "match": "(?:[^@\\s*/]|\\*[^/])+" } ] }, { "begin": "((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?={)", "beginCaptures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" } }, "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])", "patterns": [ { "include": "#jsdoctype" }, { "name": "variable.other.jsdoc", "match": "([A-Za-z_$][\\w$.\\[\\]]*)" }, { "name": "variable.other.jsdoc", "begin": "\\[", "end": "\\]|(?=\\*/)", "patterns": [ { "match": "(=)((?:[^\\]*]|\\*[^/])*)", "captures": { "1": { "name": "keyword.operator.assignment.jsdoc" }, "2": { "name": "source.embedded.js" } } }, { "include": "#brackets" }, { "include": "#quotes" } ] } ] }, { "begin": "((@)(?:define|enum|exception|implements|modifies|namespace|private|protected|returns?|suppress|throws|type))\\s+(?={)", "beginCaptures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" } }, "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])", "patterns": [ { "include": "#jsdoctype" } ] }, { "match": "(?x)\n(\n (@)\n (?:alias|augments|callback|constructs|emits|event|fires|exports?\n |extends|external|function|func|host|lends|listens|interface|memberof!?\n |method|module|mixes|mixin|name|requires|see|this|typedef|uses)\n)\n\\s+\n(\n (?:\n [^{}@\\s*] | \\*[^/]\n )+\n)", "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "entity.name.type.instance.jsdoc" } } }, { "contentName": "variable.other.jsdoc", "begin": "((@)(?:default(?:value)?|license|version))\\s+(([''\"]))", "beginCaptures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "variable.other.jsdoc" }, "4": { "name": "punctuation.definition.string.begin.jsdoc" } }, "end": "(\\3)|(?=$|\\*/)", "endCaptures": { "0": { "name": "variable.other.jsdoc" }, "1": { "name": "punctuation.definition.string.end.jsdoc" } } }, { "match": "((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^\\s*]+)", "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "variable.other.jsdoc" } } }, { "name": "storage.type.class.jsdoc", "match": "(?x) (@) (?:abstract|access|alias|arg|argument|async|attribute|augments|author|beta|borrows|bubbles |callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright |default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception |exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func |function|global|host|ignore|implements|implicitCast|inherit[Dd]oc|inner|instance|interface|kind |lends|license|listens|main|member|memberof!?|method|mixes|mixins?|modifies|module|name|namespace |noalias|nocollapse|nocompile|nosideeffects|override|overview|package|param|preserve|private|prop |property|protected|public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule |summary|suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation |version|virtual|writeOnce) \\b", "captures": { "1": { "name": "punctuation.definition.block.tag.jsdoc" } } }, { "include": "#inline-tags" } ] }, "brackets": { "patterns": [ { "begin": "{", "end": "}|(?=\\*/)", "patterns": [ { "include": "#brackets" } ] }, { "begin": "\\[", "end": "\\]|(?=\\*/)", "patterns": [ { "include": "#brackets" } ] } ] }, "inline-tags": { "patterns": [ { "name": "constant.other.description.jsdoc", "match": "(\\[)[^\\]]+(\\])(?={@(?:link|linkcode|linkplain|tutorial))", "captures": { "1": { "name": "punctuation.definition.bracket.square.begin.jsdoc" }, "2": { "name": "punctuation.definition.bracket.square.end.jsdoc" } } }, { "name": "entity.name.type.instance.jsdoc", "begin": "({)((@)(?:link(?:code|plain)?|tutorial))\\s*", "beginCaptures": { "1": { "name": "punctuation.definition.bracket.curly.begin.jsdoc" }, "2": { "name": "storage.type.class.jsdoc" }, "3": { "name": "punctuation.definition.inline.tag.jsdoc" } }, "end": "}|(?=\\*/)", "endCaptures": { "0": { "name": "punctuation.definition.bracket.curly.end.jsdoc" } }, "patterns": [ { "match": "\\G((?=https?://)(?:[^|}\\s*]|\\*[/])+)(\\|)?", "captures": { "1": { "name": "variable.other.link.underline.jsdoc" }, "2": { "name": "punctuation.separator.pipe.jsdoc" } } }, { "match": "\\G((?:[^{}@\\s|*]|\\*[^/])+)(\\|)?", "captures": { "1": { "name": "variable.other.description.jsdoc" }, "2": { "name": "punctuation.separator.pipe.jsdoc" } } } ] } ] }, "quotes": { "patterns": [ { "begin": "'", "end": "'|(?=\\*/)", "patterns": [ { "include": "#quotes" } ] }, { "begin": "\"", "end": "\"|(?=\\*/)", "patterns": [ { "include": "#quotes" } ] } ] }, "jsdoctype": { "patterns": [ { "name": "invalid.illegal.type.jsdoc", "match": "\\G{(?:[^}*]|\\*[^/}])+$" }, { "contentName": "entity.name.type.instance.jsdoc", "begin": "\\G({)", "beginCaptures": { "0": { "name": "entity.name.type.instance.jsdoc" }, "1": { "name": "punctuation.definition.bracket.curly.begin.jsdoc" } }, "end": "((}))\\s*|(?=\\*/)", "endCaptures": { "1": { "name": "entity.name.type.instance.jsdoc" }, "2": { "name": "punctuation.definition.bracket.curly.end.jsdoc" } }, "patterns": [ { "include": "#brackets" } ] } ] }, "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.js" } } }, "jsx-tag-attribute-assignment": { "name": "keyword.operator.assignment.js", "match": "=(?=\\s*(?:'|\"|{|/\\*|//|\\n))" }, "jsx-string-double-quoted": { "name": "string.quoted.double.js", "begin": "\"", "end": "\"", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.js" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.js" } }, "patterns": [ { "include": "#jsx-entities" } ] }, "jsx-string-single-quoted": { "name": "string.quoted.single.js", "begin": "'", "end": "'", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.js" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.js" } }, "patterns": [ { "include": "#jsx-entities" } ] }, "jsx-entities": { "patterns": [ { "name": "constant.character.entity.js", "match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)", "captures": { "1": { "name": "punctuation.definition.entity.js" }, "3": { "name": "punctuation.definition.entity.js" } } }, { "name": "invalid.illegal.bad-ampersand.js", "match": "&" } ] }, "jsx-evaluated-code": { "name": "meta.embedded.expression.js", "begin": "\\{", "end": "\\}", "beginCaptures": { "0": { "name": "punctuation.section.embedded.begin.js" } }, "endCaptures": { "0": { "name": "punctuation.section.embedded.end.js" } }, "patterns": [ { "include": "#expression" } ] }, "jsx-tag-attributes-illegal": { "name": "invalid.illegal.attribute.js", "match": "\\S+" }, "jsx-tag-without-attributes": { "name": "meta.tag.without-attributes.js", "begin": "(<)\\s*((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\\w.]*))(?)", "end": "()", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.js" }, "2": { "name": "entity.name.tag.js" }, "3": { "name": "support.class.component.js" }, "4": { "name": "punctuation.definition.tag.end.js" } }, "endCaptures": { "1": { "name": "punctuation.definition.tag.begin.js" }, "2": { "name": "entity.name.tag.js" }, "3": { "name": "support.class.component.js" }, "4": { "name": "punctuation.definition.tag.end.js" } }, "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.js" }, "1": { "name": "punctuation.definition.tag.end.js" }, "2": { "name": "punctuation.definition.tag.begin.js" }, "3": { "name": "entity.name.tag.js" }, "4": { "name": "support.class.component.js" }, "5": { "name": "punctuation.definition.tag.end.js" } }, "patterns": [ { "include": "#jsx-tag" } ] }, "jsx-child-tag": { "begin": "(?x)\n (?=(<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?))", "end": "(/>)|(?:())", "endCaptures": { "0": { "name": "meta.tag.js" }, "1": { "name": "punctuation.definition.tag.end.js" }, "2": { "name": "punctuation.definition.tag.begin.js" }, "3": { "name": "entity.name.tag.js" }, "4": { "name": "support.class.component.js" }, "5": { "name": "punctuation.definition.tag.end.js" } }, "patterns": [ { "include": "#jsx-tag" } ] }, "jsx-tag": { "name": "meta.tag.js", "begin": "(?x)\n (?=(<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?))", "end": "(?=(/>)|(?:()))", "patterns": [ { "begin": "(?x)\n (<)\\s*\n ((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\\w.]*))(?)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.js" }, "2": { "name": "entity.name.tag.js" }, "3": { "name": "support.class.component.js" } }, "end": "(?=[/]?>)", "patterns": [ { "include": "#comment" }, { "include": "#jsx-tag-attributes" }, { "include": "#jsx-tag-attributes-illegal" } ] }, { "begin": "(>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.end.js" } }, "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" } ] } }, "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/8c967fe7553297bfad672b7417d78e357c8fe724" }