diff --git a/TypeScript.tmLanguage b/TypeScript.tmLanguage index 15c014ce..816d25bd 100644 --- a/TypeScript.tmLanguage +++ b/TypeScript.tmLanguage @@ -190,6 +190,10 @@ match (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(case|default|switch)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)) + + include + #if-statement + name keyword.control.conditional.ts @@ -611,7 +615,7 @@ name meta.var-single-variable.expr.ts begin - (?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\s* + (?x)([_$[:alpha:]][_$[:alnum:]]*)(\!)?(?=\s* # function assignment | (=\s*( ((async\s+)?( @@ -691,6 +695,11 @@ name meta.definition.variable.ts entity.name.function.ts + 2 + + name + keyword.operator.definiteassignment.ts + end (?=$|^|[;,=}]|(\s+(of|in)\s+)) @@ -706,7 +715,7 @@ name meta.var-single-variable.expr.ts begin - ([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]]) + ([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])(\!)? beginCaptures 1 @@ -714,6 +723,11 @@ name meta.definition.variable.ts variable.other.constant.ts + 2 + + name + keyword.operator.definiteassignment.ts + end (?=$|^|[;,=}]|(\s+(of|in)\s+)) @@ -729,7 +743,7 @@ name meta.var-single-variable.expr.ts begin - ([_$[:alpha:]][_$[:alnum:]]*) + ([_$[:alpha:]][_$[:alnum:]]*)(\!)? beginCaptures 1 @@ -737,6 +751,11 @@ name meta.definition.variable.ts variable.other.readwrite.ts + 2 + + name + keyword.operator.definiteassignment.ts + end (?=$|^|[;,=}]|(\s+(of|in)\s+)) @@ -1157,6 +1176,14 @@ include #string + + include + #numeric-literal + + + include + #regex + include #object-binding-pattern @@ -1187,6 +1214,14 @@ include #string + + include + #numeric-literal + + + include + #regex + include #object-binding-pattern-const @@ -1689,6 +1724,14 @@ include #string + + include + #numeric-literal + + + include + #regex + include #parameter-object-binding-pattern @@ -1813,7 +1856,7 @@ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1. (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1 -)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:|;|,|$)) +)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(?:(?:(\?)|(\!))\s*)?(=|:|;|,|$)) beginCaptures 1 @@ -1832,7 +1875,7 @@ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1. (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1 -)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:|;|,|$))))|(?<=\}) +)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(?:(?:(\?)|(\!))\s*)?(=|:|;|,|$))))|(?<=\}) patterns @@ -1861,7 +1904,7 @@ match - (?x)([_$[:alpha:]][_$[:alnum:]]*)(\?)?(?=(\?\s*)?\s* + (?x)([_$[:alpha:]][_$[:alnum:]]*)(?:(\?)|(\!))?(?=\s*\s* # function assignment | (=\s*( ((async\s+)?( @@ -1946,6 +1989,11 @@ name keyword.operator.optional.ts + 3 + + name + keyword.operator.definiteassignment.ts + @@ -1960,6 +2008,12 @@ match \? + + name + keyword.operator.definiteassignment.ts + match + \! + variable-initializer @@ -1968,7 +2022,7 @@ begin - (?<!=|!)(=)(?!=)(?=\s*\S) + (?<!=|!)(=)(?!=)(?=\s*\S)(?!\s*.*=>\s*$) beginCaptures 1 @@ -2199,7 +2253,7 @@ name meta.method.declaration.ts begin - (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:(?:\s*\b(new)\b(?!:)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|(?:(\*)\s*)?)(?=\s*[\(\<]) + (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:(?:\s*\b(new)\b(?!:)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|(?:(\*)\s*)?)(?=\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?[\(]) beginCaptures 1 @@ -2255,7 +2309,7 @@ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1. (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1 -)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*[\(\<]) +)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?[\(]) beginCaptures 1 @@ -2314,7 +2368,7 @@ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1. (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1 -)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*[\(\<]) +)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?[\(]) beginCaptures 1 @@ -2356,7 +2410,7 @@ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1. (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1 -)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*[\(\<]) +)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?[\(]) beginCaptures 1 @@ -2716,7 +2770,7 @@ include - #type-annotation + #parameter-type-annotation include @@ -2774,10 +2828,15 @@ name meta.class.ts begin - (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(class)\b(?=\s+|[<{]|\/[\/*]) + (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(abstract)\s+)?(class)\b(?=\s+|[<{]|\/[\/*]) beginCaptures 1 + + name + storage.modifier.ts + + 2 name storage.type.class.ts @@ -2994,6 +3053,19 @@ include #decorator + + begin + (?<=:)\s* + end + (?=\s|[;),}\]:\-\+]|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b)) + patterns + + + include + #expression + + + include #method-declaration @@ -3962,6 +4034,99 @@ + if-statement + + patterns + + + begin + (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?=\bif\s*(\(([^\(\)]|(\([^\(\)]*\)))*\))\s*(?!\{)) + end + (?=;|$) + patterns + + + include + #comment + + + begin + (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(if)\s*(\() + beginCaptures + + 1 + + name + keyword.control.conditional.ts + + 2 + + name + meta.brace.round.ts + + + end + \) + endCaptures + + 0 + + name + meta.brace.round.ts + + + patterns + + + include + #expression + + + + + name + string.regexp.ts + begin + (?<=\))\s*\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$])) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ts + + + end + (/)([gimsuy]*) + endCaptures + + 1 + + name + punctuation.definition.string.end.ts + + 2 + + name + keyword.other.ts + + + patterns + + + include + #regexp + + + + + include + #statements + + + + + decl-block name @@ -4093,9 +4258,9 @@ name meta.object.member.ts meta.object-literal.key.ts begin - (?=[\'\"]) + (?=[\'\"\`]) end - (?=:)|((?<=[\'\"])(?=\s*[\(\<])) + (?=:)|((?<=[\'\"\`])(?=((\s*[\(\<,}])|(\s+(as)\s+)))) patterns @@ -4108,11 +4273,39 @@ + + name + meta.object.member.ts meta.object-literal.key.ts + begin + (?x)(?=(\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?: + (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3 + (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3 + (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3 + (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3 + (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1 + (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1. + (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1 + (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1 +)(?!\$))) + end + (?=:)|(?=\s*([\(\<,}])|(\s+as\s+)) + patterns + + + include + #comment + + + include + #numeric-literal + + + name meta.method.declaration.ts begin - (?<=[\]\'\"])(?=\s*[\(\<]) + (?<=[\]\'\"\`])(?=\s*[\(\<]) end (?=\}|;|,)|(?<=\}) patterns @@ -4240,6 +4433,48 @@ + + name + meta.object.member.ts + match + (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+(const)(?=\s*([,}]|$)) + captures + + 1 + + name + keyword.control.as.ts + + 2 + + name + storage.modifier.ts + + + + + name + meta.object.member.ts + begin + (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+ + beginCaptures + + 1 + + name + keyword.control.as.ts + + + end + (?=$|^|[,}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+)) + patterns + + + include + #type + + + name meta.object.member.ts @@ -4401,9 +4636,9 @@ function-call begin - (?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\s*(\?\.\s*)?(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)?\() + (?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\s*(\?\.\s*)?(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\() end - (?<=\))(?!(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\s*(\?\.\s*)?(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)?\() + (?<=\))(?!(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\s*(\?\.\s*)?(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\() patterns @@ -4412,30 +4647,12 @@ begin (?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)) end - (?=\s*(\?\.\s*)?(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)?\() + (?=\s*(\?\.\s*)?(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\() patterns include - #literal - - - include - #support-objects - - - include - #object-identifiers - - - include - #punctuation-accessor - - - name - keyword.operator.expression.import.ts - match - (?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))import(?=\s*[\(]\s*[\"\'\`])) + #support-function-call-identifiers name @@ -4465,6 +4682,34 @@ + support-function-call-identifiers + + patterns + + + include + #literal + + + include + #support-objects + + + include + #object-identifiers + + + include + #punctuation-accessor + + + name + keyword.operator.expression.import.ts + match + (?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))import(?=\s*[\(]\s*[\"\'\`])) + + + new-expr name @@ -4620,15 +4865,189 @@ include - #function-parameters-body + #comment include - #identifiers + #string include - #expressionPunctuations + #decorator + + + include + #destructuring-parameter + + + match + (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|protected|private|readonly)\s+(?=(public|protected|private|readonly)\s+) + captures + + 1 + + name + storage.modifier.ts + + + + + match + (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s* +# function assignment | +(=\s*( + ((async\s+)?( + (function\s*[(<*]) | + (function\s+) | + ([_$[:alpha:]][_$[:alnum:]]*\s*=>) + )) | + ((async\s*)?( + ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line +( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) +) | +( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends +) | +# arrow function possible to detect only with => on same line +( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)\{\}]|\<[^<>]+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type + \s*=> # arrow operator +) + )) +)) | +# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) => +(:\s*( + (<) | + ([(]\s*( + ([)]) | + (\.\.\.) | + ([_$[:alnum:]]+\s*( + ([:,?=])| + ([)]\s*=>) + )) + )) +)) | +(:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$))) | +(:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*( + ((async\s+)?( + (function\s*[(<*]) | + (function\s+) | + ([_$[:alpha:]][_$[:alnum:]]*\s*=>) + )) | + ((async\s*)?( + ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line +( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) +) | +( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends +) | +# arrow function possible to detect only with => on same line +( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)\{\}]|\<[^<>]+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type + \s*=> # arrow operator +) + )) +))) + captures + + 1 + + name + storage.modifier.ts + + 2 + + name + keyword.operator.rest.ts + + 3 + + name + entity.name.function.ts variable.language.this.ts + + 4 + + name + entity.name.function.ts + + 5 + + name + keyword.operator.optional.ts + + + + + match + (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*:) + captures + + 1 + + name + storage.modifier.ts + + 2 + + name + keyword.operator.rest.ts + + 3 + + name + variable.parameter.ts variable.language.this.ts + + 4 + + name + variable.parameter.ts + + 5 + + name + keyword.operator.optional.ts + + + + + include + #type-annotation + + + include + #variable-initializer + + + name + punctuation.separator.parameter.ts + match + , + + + include + #identifiers + + + include + #expressionPunctuations @@ -4666,6 +5085,30 @@ patterns + + name + cast.expr.ts + match + \s*(<)\s*(const)\s*(>) + captures + + 1 + + name + meta.brace.angle.ts + + 2 + + name + storage.modifier.ts + + 3 + + name + meta.brace.angle.ts + + + name cast.expr.ts @@ -4826,6 +5269,23 @@ match (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))void(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)) + + match + (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+(const)(?=\s*($|[;,:})\]])) + captures + + 1 + + name + keyword.control.as.ts + + 2 + + name + storage.modifier.ts + + + begin (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+ @@ -5406,9 +5866,9 @@ match (?x) (?:(\.)|(\?\.(?!\s*[[:digit:]]))) \s* (?: - (constructor|length|prototype|__proto__) + (?:(constructor|length|prototype|__proto__)\b(?!\$|\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?\()) | - (EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY))\b(?!\$) + (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\b(?!\$))) captures 1 @@ -5995,6 +6455,35 @@ + parameter-type-annotation + + patterns + + + name + meta.type.annotation.ts + begin + (:) + beginCaptures + + 1 + + name + keyword.operator.type.annotation.ts + + + end + (?=[,)])|(?==[^>]) + patterns + + + include + #type + + + + + return-type patterns @@ -6229,6 +6718,16 @@ punctuation.definition.typeparameters.end.ts + patterns + + + include + #type-arguments-body + + + + type-arguments-body + patterns @@ -6279,7 +6778,7 @@ include - #type-arguments + #type-parameters include @@ -6309,6 +6808,12 @@ include #type-function-return-type + + name + storage.modifier.ts + match + (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(readonly)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)) + include #type-name @@ -6628,18 +7133,29 @@ patterns - name - meta.type.constructor.ts - match + begin (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(new)\b(?=\s*\<) - captures + beginCaptures 1 name - keyword.control.new.ts + meta.type.constructor.ts keyword.control.new.ts + end + (?<=>) + patterns + + + include + #comment + + + include + #type-parameters + + name @@ -6855,6 +7371,88 @@ patterns + + begin + ([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(<) + captures + + 1 + + name + entity.name.type.module.ts + + 2 + + name + punctuation.accessor.ts + + 3 + + name + punctuation.accessor.optional.ts + + 4 + + name + meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts + + + end + (>) + endCaptures + + 1 + + name + meta.type.parameters.ts punctuation.definition.typeparameters.end.ts + + + contentName + meta.type.parameters.ts + patterns + + + include + #type-arguments-body + + + + + begin + ([_$[:alpha:]][_$[:alnum:]]*)\s*(<) + beginCaptures + + 1 + + name + entity.name.type.ts + + 2 + + name + meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts + + + end + (>) + endCaptures + + 1 + + name + meta.type.parameters.ts punctuation.definition.typeparameters.end.ts + + + contentName + meta.type.parameters.ts + patterns + + + include + #type-arguments-body + + + match ([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]]))) @@ -7024,7 +7622,41 @@ name string.template.ts begin - ([_$[:alpha:]][_$[:alnum:]]*)\s*(?=(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)`) + (?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?`) + end + (?=`) + patterns + + + begin + (?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)) + end + (?=(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?`) + patterns + + + include + #support-function-call-identifiers + + + name + entity.name.function.tagged-template.ts + match + ([_$[:alpha:]][_$[:alnum:]]*) + + + + + include + #type-arguments + + + + + name + string.template.ts + begin + ([_$[:alpha:]][_$[:alnum:]]*)\s*(?=(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)`) beginCaptures 1 @@ -7127,7 +7759,7 @@ name string.regexp.ts begin - (?<!\+\+|--|})(?<=[=(:,\[?+!]|^return|[^\._$[:alnum:]]return|^case|[^\._$[:alnum:]]case|=>|&&|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$])) + (?<!\+\+|--|})(?<=[=(:,\[?+!]|^return|[^\._$[:alnum:]]return|^case|[^\._$[:alnum:]]case|=>|&&|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[\()]|\\.|\[([^\]\\]|\\.)+\]|\(([^\)\\]|\\.)+\))+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$])) beginCaptures 1 @@ -7163,7 +7795,7 @@ name string.regexp.ts begin - (?<![_$[:alnum:])\]]|\+\+|--|})\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$])) + (?<![_$[:alnum:])\]]|\+\+|--|}|\*\/)\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$])) beginCaptures 0 @@ -8263,6 +8895,23 @@ include #inline-tags + + match + ((@)(?:[_$[:alpha:]][_$[:alnum:]]*))(?=\s+) + captures + + 1 + + name + storage.type.class.jsdoc + + 2 + + name + punctuation.definition.block.tag.jsdoc + + + brackets diff --git a/TypeScriptReact.tmLanguage b/TypeScriptReact.tmLanguage index f5cf7cb0..de465829 100644 --- a/TypeScriptReact.tmLanguage +++ b/TypeScriptReact.tmLanguage @@ -190,6 +190,10 @@ match (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(case|default|switch)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)) + + include + #if-statement + name keyword.control.conditional.tsx @@ -615,7 +619,7 @@ name meta.var-single-variable.expr.tsx begin - (?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\s* + (?x)([_$[:alpha:]][_$[:alnum:]]*)(\!)?(?=\s* # function assignment | (=\s*( ((async\s+)?( @@ -695,6 +699,11 @@ name meta.definition.variable.tsx entity.name.function.tsx + 2 + + name + keyword.operator.definiteassignment.tsx + end (?=$|^|[;,=}]|(\s+(of|in)\s+)) @@ -710,7 +719,7 @@ name meta.var-single-variable.expr.tsx begin - ([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]]) + ([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])(\!)? beginCaptures 1 @@ -718,6 +727,11 @@ name meta.definition.variable.tsx variable.other.constant.tsx + 2 + + name + keyword.operator.definiteassignment.tsx + end (?=$|^|[;,=}]|(\s+(of|in)\s+)) @@ -733,7 +747,7 @@ name meta.var-single-variable.expr.tsx begin - ([_$[:alpha:]][_$[:alnum:]]*) + ([_$[:alpha:]][_$[:alnum:]]*)(\!)? beginCaptures 1 @@ -741,6 +755,11 @@ name meta.definition.variable.tsx variable.other.readwrite.tsx + 2 + + name + keyword.operator.definiteassignment.tsx + end (?=$|^|[;,=}]|(\s+(of|in)\s+)) @@ -1161,6 +1180,14 @@ include #string + + include + #numeric-literal + + + include + #regex + include #object-binding-pattern @@ -1191,6 +1218,14 @@ include #string + + include + #numeric-literal + + + include + #regex + include #object-binding-pattern-const @@ -1693,6 +1728,14 @@ include #string + + include + #numeric-literal + + + include + #regex + include #parameter-object-binding-pattern @@ -1817,7 +1860,7 @@ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1. (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1 -)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:|;|,|$)) +)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(?:(?:(\?)|(\!))\s*)?(=|:|;|,|$)) beginCaptures 1 @@ -1836,7 +1879,7 @@ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1. (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1 -)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:|;|,|$))))|(?<=\}) +)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(?:(?:(\?)|(\!))\s*)?(=|:|;|,|$))))|(?<=\}) patterns @@ -1865,7 +1908,7 @@ match - (?x)([_$[:alpha:]][_$[:alnum:]]*)(\?)?(?=(\?\s*)?\s* + (?x)([_$[:alpha:]][_$[:alnum:]]*)(?:(\?)|(\!))?(?=\s*\s* # function assignment | (=\s*( ((async\s+)?( @@ -1950,6 +1993,11 @@ name keyword.operator.optional.tsx + 3 + + name + keyword.operator.definiteassignment.tsx + @@ -1964,6 +2012,12 @@ match \? + + name + keyword.operator.definiteassignment.tsx + match + \! + variable-initializer @@ -1972,7 +2026,7 @@ begin - (?<!=|!)(=)(?!=)(?=\s*\S) + (?<!=|!)(=)(?!=)(?=\s*\S)(?!\s*.*=>\s*$) beginCaptures 1 @@ -2203,7 +2257,7 @@ name meta.method.declaration.tsx begin - (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:(?:\s*\b(new)\b(?!:)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|(?:(\*)\s*)?)(?=\s*[\(\<]) + (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:(?:\s*\b(new)\b(?!:)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|(?:(\*)\s*)?)(?=\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?[\(]) beginCaptures 1 @@ -2259,7 +2313,7 @@ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1. (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1 -)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*[\(\<]) +)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?[\(]) beginCaptures 1 @@ -2318,7 +2372,7 @@ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1. (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1 -)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*[\(\<]) +)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?[\(]) beginCaptures 1 @@ -2360,7 +2414,7 @@ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1. (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1 -)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*[\(\<]) +)(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\`([^\`\\]|\\\`|\\)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?[\(]) beginCaptures 1 @@ -2720,7 +2774,7 @@ include - #type-annotation + #parameter-type-annotation include @@ -2778,10 +2832,15 @@ name meta.class.tsx begin - (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(class)\b(?=\s+|[<{]|\/[\/*]) + (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(abstract)\s+)?(class)\b(?=\s+|[<{]|\/[\/*]) beginCaptures 1 + + name + storage.modifier.tsx + + 2 name storage.type.class.tsx @@ -2998,6 +3057,19 @@ include #decorator + + begin + (?<=:)\s* + end + (?=\s|[;),}\]:\-\+]|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b)) + patterns + + + include + #expression + + + include #method-declaration @@ -3966,6 +4038,99 @@ + if-statement + + patterns + + + begin + (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?=\bif\s*(\(([^\(\)]|(\([^\(\)]*\)))*\))\s*(?!\{)) + end + (?=;|$) + patterns + + + include + #comment + + + begin + (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(if)\s*(\() + beginCaptures + + 1 + + name + keyword.control.conditional.tsx + + 2 + + name + meta.brace.round.tsx + + + end + \) + endCaptures + + 0 + + name + meta.brace.round.tsx + + + patterns + + + include + #expression + + + + + name + string.regexp.tsx + begin + (?<=\))\s*\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$])) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.tsx + + + end + (/)([gimsuy]*) + endCaptures + + 1 + + name + punctuation.definition.string.end.tsx + + 2 + + name + keyword.other.tsx + + + patterns + + + include + #regexp + + + + + include + #statements + + + + + decl-block name @@ -4097,9 +4262,9 @@ name meta.object.member.tsx meta.object-literal.key.tsx begin - (?=[\'\"]) + (?=[\'\"\`]) end - (?=:)|((?<=[\'\"])(?=\s*[\(\<])) + (?=:)|((?<=[\'\"\`])(?=((\s*[\(\<,}])|(\s+(as)\s+)))) patterns @@ -4112,11 +4277,39 @@ + + name + meta.object.member.tsx meta.object-literal.key.tsx + begin + (?x)(?=(\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?: + (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3 + (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3 + (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3 + (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3 + (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1 + (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1. + (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1 + (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1 +)(?!\$))) + end + (?=:)|(?=\s*([\(\<,}])|(\s+as\s+)) + patterns + + + include + #comment + + + include + #numeric-literal + + + name meta.method.declaration.tsx begin - (?<=[\]\'\"])(?=\s*[\(\<]) + (?<=[\]\'\"\`])(?=\s*[\(\<]) end (?=\}|;|,)|(?<=\}) patterns @@ -4244,6 +4437,48 @@ + + name + meta.object.member.tsx + match + (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+(const)(?=\s*([,}]|$)) + captures + + 1 + + name + keyword.control.as.tsx + + 2 + + name + storage.modifier.tsx + + + + + name + meta.object.member.tsx + begin + (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+ + beginCaptures + + 1 + + name + keyword.control.as.tsx + + + end + (?=$|^|[,}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+)) + patterns + + + include + #type + + + name meta.object.member.tsx @@ -4405,9 +4640,9 @@ function-call begin - (?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\s*(\?\.\s*)?(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)?\() + (?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\s*(\?\.\s*)?(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\() end - (?<=\))(?!(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\s*(\?\.\s*)?(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)?\() + (?<=\))(?!(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\s*(\?\.\s*)?(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\() patterns @@ -4416,30 +4651,12 @@ begin (?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)) end - (?=\s*(\?\.\s*)?(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)?\() + (?=\s*(\?\.\s*)?(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\() patterns include - #literal - - - include - #support-objects - - - include - #object-identifiers - - - include - #punctuation-accessor - - - name - keyword.operator.expression.import.tsx - match - (?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))import(?=\s*[\(]\s*[\"\'\`])) + #support-function-call-identifiers name @@ -4469,6 +4686,34 @@ + support-function-call-identifiers + + patterns + + + include + #literal + + + include + #support-objects + + + include + #object-identifiers + + + include + #punctuation-accessor + + + name + keyword.operator.expression.import.tsx + match + (?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))import(?=\s*[\(]\s*[\"\'\`])) + + + new-expr name @@ -4624,15 +4869,189 @@ include - #function-parameters-body + #comment include - #identifiers + #string include - #expressionPunctuations + #decorator + + + include + #destructuring-parameter + + + match + (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|protected|private|readonly)\s+(?=(public|protected|private|readonly)\s+) + captures + + 1 + + name + storage.modifier.tsx + + + + + match + (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s* +# function assignment | +(=\s*( + ((async\s+)?( + (function\s*[(<*]) | + (function\s+) | + ([_$[:alpha:]][_$[:alnum:]]*\s*=>) + )) | + ((async\s*)?( + ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line +( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) +) | +( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends +) | +# arrow function possible to detect only with => on same line +( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)\{\}]|\<[^<>]+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type + \s*=> # arrow operator +) + )) +)) | +# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) => +(:\s*( + (<) | + ([(]\s*( + ([)]) | + (\.\.\.) | + ([_$[:alnum:]]+\s*( + ([:,?=])| + ([)]\s*=>) + )) + )) +)) | +(:\s*((<\s*$)|([\(]\s*([\{\[]\s*)?$))) | +(:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*( + ((async\s+)?( + (function\s*[(<*]) | + (function\s+) | + ([_$[:alpha:]][_$[:alnum:]]*\s*=>) + )) | + ((async\s*)?( + ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line +( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) +) | +( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends +) | +# arrow function possible to detect only with => on same line +( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)\{\}]|\<[^<>]+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type + \s*=> # arrow operator +) + )) +))) + captures + + 1 + + name + storage.modifier.tsx + + 2 + + name + keyword.operator.rest.tsx + + 3 + + name + entity.name.function.tsx variable.language.this.tsx + + 4 + + name + entity.name.function.tsx + + 5 + + name + keyword.operator.optional.tsx + + + + + match + (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*:) + captures + + 1 + + name + storage.modifier.tsx + + 2 + + name + keyword.operator.rest.tsx + + 3 + + name + variable.parameter.tsx variable.language.this.tsx + + 4 + + name + variable.parameter.tsx + + 5 + + name + keyword.operator.optional.tsx + + + + + include + #type-annotation + + + include + #variable-initializer + + + name + punctuation.separator.parameter.tsx + match + , + + + include + #identifiers + + + include + #expressionPunctuations @@ -4772,6 +5191,23 @@ match (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))void(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)) + + match + (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+(const)(?=\s*($|[;,:})\]])) + captures + + 1 + + name + keyword.control.as.tsx + + 2 + + name + storage.modifier.tsx + + + begin (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+ @@ -5352,9 +5788,9 @@ match (?x) (?:(\.)|(\?\.(?!\s*[[:digit:]]))) \s* (?: - (constructor|length|prototype|__proto__) + (?:(constructor|length|prototype|__proto__)\b(?!\$|\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?\()) | - (EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY))\b(?!\$) + (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\b(?!\$))) captures 1 @@ -5941,6 +6377,35 @@ + parameter-type-annotation + + patterns + + + name + meta.type.annotation.tsx + begin + (:) + beginCaptures + + 1 + + name + keyword.operator.type.annotation.tsx + + + end + (?=[,)])|(?==[^>]) + patterns + + + include + #type + + + + + return-type patterns @@ -6175,6 +6640,16 @@ punctuation.definition.typeparameters.end.tsx + patterns + + + include + #type-arguments-body + + + + type-arguments-body + patterns @@ -6225,7 +6700,7 @@ include - #type-arguments + #type-parameters include @@ -6255,6 +6730,12 @@ include #type-function-return-type + + name + storage.modifier.tsx + match + (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(readonly)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)) + include #type-name @@ -6574,18 +7055,29 @@ patterns - name - meta.type.constructor.tsx - match + begin (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(new)\b(?=\s*\<) - captures + beginCaptures 1 name - keyword.control.new.tsx + meta.type.constructor.tsx keyword.control.new.tsx + end + (?<=>) + patterns + + + include + #comment + + + include + #type-parameters + + name @@ -6801,6 +7293,88 @@ patterns + + begin + ([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(<) + captures + + 1 + + name + entity.name.type.module.tsx + + 2 + + name + punctuation.accessor.tsx + + 3 + + name + punctuation.accessor.optional.tsx + + 4 + + name + meta.type.parameters.tsx punctuation.definition.typeparameters.begin.tsx + + + end + (>) + endCaptures + + 1 + + name + meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx + + + contentName + meta.type.parameters.tsx + patterns + + + include + #type-arguments-body + + + + + begin + ([_$[:alpha:]][_$[:alnum:]]*)\s*(<) + beginCaptures + + 1 + + name + entity.name.type.tsx + + 2 + + name + meta.type.parameters.tsx punctuation.definition.typeparameters.begin.tsx + + + end + (>) + endCaptures + + 1 + + name + meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx + + + contentName + meta.type.parameters.tsx + patterns + + + include + #type-arguments-body + + + match ([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]]))) @@ -6970,7 +7544,41 @@ name string.template.tsx begin - ([_$[:alpha:]][_$[:alnum:]]*)\s*(?=(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)`) + (?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?`) + end + (?=`) + patterns + + + begin + (?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)) + end + (?=(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?`) + patterns + + + include + #support-function-call-identifiers + + + name + entity.name.function.tagged-template.tsx + match + ([_$[:alpha:]][_$[:alnum:]]*) + + + + + include + #type-arguments + + + + + name + string.template.tsx + begin + ([_$[:alpha:]][_$[:alnum:]]*)\s*(?=(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)`) beginCaptures 1 @@ -7073,7 +7681,7 @@ name string.regexp.tsx begin - (?<!\+\+|--|})(?<=[=(:,\[?+!]|^return|[^\._$[:alnum:]]return|^case|[^\._$[:alnum:]]case|=>|&&|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$])) + (?<!\+\+|--|})(?<=[=(:,\[?+!]|^return|[^\._$[:alnum:]]return|^case|[^\._$[:alnum:]]case|=>|&&|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[\()]|\\.|\[([^\]\\]|\\.)+\]|\(([^\)\\]|\\.)+\))+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$])) beginCaptures 1 @@ -7109,7 +7717,7 @@ name string.regexp.tsx begin - (?<![_$[:alnum:])\]]|\+\+|--|})\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$])) + (?<![_$[:alnum:])\]]|\+\+|--|}|\*\/)\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$])) beginCaptures 0 @@ -8209,6 +8817,23 @@ include #inline-tags + + match + ((@)(?:[_$[:alpha:]][_$[:alnum:]]*))(?=\s+) + captures + + 1 + + name + storage.type.class.jsdoc + + 2 + + name + punctuation.definition.block.tag.jsdoc + + + brackets