Родитель
95bce1d124
Коммит
27425437b2
|
@ -81,7 +81,8 @@ variables:
|
|||
(\s*:{{returnTypeOfArrow}})? # return type
|
||||
\s*=> # arrow operator
|
||||
)
|
||||
possiblyMultilineArrow: ({{typeParameters}}?[\(]\s*([\{\[]\s*)?$) # during lookup treat <typeparameters>?( followed by line end as arrow
|
||||
possiblyMultilineArrowExpressionBeforeEndOfLine: ((({{typeParameters}})?\()|(<))
|
||||
possiblyMultilineArrow: ((<\s*$)|({{typeParameters}}?[\(]\s*([\{\[]\s*)?$)) # during lookup treat <typeparameters>?( followed by line end as arrow or < followed by new line
|
||||
functionOrArrowLookup: |-
|
||||
\s*(
|
||||
((async\s+)?(
|
||||
|
@ -1264,7 +1265,7 @@ repository:
|
|||
end: (?<=\))
|
||||
patterns:
|
||||
- include: '#paren-expression-possibly-arrow-with-typeparameters'
|
||||
- begin: '{{lookBehindOfPossiblyMultilineArrow}}\s*(async)?(?=\s*({{typeParameters}})?\(\s*$)'
|
||||
- begin: '{{lookBehindOfPossiblyMultilineArrow}}\s*(async)?(?=\s*{{possiblyMultilineArrowExpressionBeforeEndOfLine}}\s*$)'
|
||||
beginCaptures:
|
||||
'1': { name: storage.modifier.async.ts }
|
||||
end: (?<=\))
|
||||
|
@ -1309,7 +1310,7 @@ repository:
|
|||
# If '<' is preceeded by 'return', 'throw', 'yield', or 'await', it's most likely a type assertion
|
||||
# If '=', '(', ',', ':', or '>' are followed by a '<', it is also likely a type assertion as otherwise it would be a syntax error
|
||||
# '<=' and '<<=' are cannot be type assertions, as they are assignment operators.
|
||||
begin: (?:(?<!\+\+|--)(?<={{lookBehindReturn}}|{{lookBehindThrow}}|{{lookBehindYield}}|{{lookBehindAwait}}|{{lookBehindDefault}}|[=(,:>*?\&\|\^]|[^_$[:alnum:]](?:\+\+|\-\-)|[^\+]\+|[^\-]\-))\s*(<)(?!<?\=)
|
||||
begin: (?:(?<!\+\+|--)(?<={{lookBehindReturn}}|{{lookBehindThrow}}|{{lookBehindYield}}|{{lookBehindAwait}}|{{lookBehindDefault}}|[=(,:>*?\&\|\^]|[^_$[:alnum:]](?:\+\+|\-\-)|[^\+]\+|[^\-]\-))\s*(<)(?!<?\=)(?!\s*$)
|
||||
beginCaptures:
|
||||
'1': { name: meta.brace.angle.ts }
|
||||
end: (\>)\s*
|
||||
|
|
|
@ -498,7 +498,7 @@
|
|||
([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
||||
)) |
|
||||
((async\s*)?(
|
||||
((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$) |
|
||||
((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
|
||||
# sure shot arrow functions even if => is on new line
|
||||
(
|
||||
(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
|
||||
|
@ -532,7 +532,7 @@
|
|||
))
|
||||
))
|
||||
)) |
|
||||
(:\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
|
||||
(:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$))) |
|
||||
(:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
|
||||
((async\s+)?(
|
||||
(function\s*[(<*]) |
|
||||
|
@ -540,7 +540,7 @@
|
|||
([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
||||
)) |
|
||||
((async\s*)?(
|
||||
((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$) |
|
||||
((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
|
||||
# sure shot arrow functions even if => is on new line
|
||||
(
|
||||
(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
|
||||
|
@ -944,7 +944,7 @@
|
|||
([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
||||
)) |
|
||||
((async\s*)?(
|
||||
((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$) |
|
||||
((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
|
||||
# sure shot arrow functions even if => is on new line
|
||||
(
|
||||
(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
|
||||
|
@ -978,7 +978,7 @@
|
|||
))
|
||||
))
|
||||
)) |
|
||||
(:\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
|
||||
(:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$))) |
|
||||
(:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
|
||||
((async\s+)?(
|
||||
(function\s*[(<*]) |
|
||||
|
@ -986,7 +986,7 @@
|
|||
([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
||||
)) |
|
||||
((async\s*)?(
|
||||
((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$) |
|
||||
((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
|
||||
# sure shot arrow functions even if => is on new line
|
||||
(
|
||||
(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
|
||||
|
@ -1413,7 +1413,7 @@
|
|||
([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
||||
)) |
|
||||
((async\s*)?(
|
||||
((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$) |
|
||||
((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
|
||||
# sure shot arrow functions even if => is on new line
|
||||
(
|
||||
(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
|
||||
|
@ -1447,7 +1447,7 @@
|
|||
))
|
||||
))
|
||||
)) |
|
||||
(:\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
|
||||
(:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$))) |
|
||||
(:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
|
||||
((async\s+)?(
|
||||
(function\s*[(<*]) |
|
||||
|
@ -1455,7 +1455,7 @@
|
|||
([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
||||
)) |
|
||||
((async\s*)?(
|
||||
((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$) |
|
||||
((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
|
||||
# sure shot arrow functions even if => is on new line
|
||||
(
|
||||
(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
|
||||
|
@ -3621,7 +3621,7 @@
|
|||
([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
||||
)) |
|
||||
((async\s*)?(
|
||||
((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$) |
|
||||
((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
|
||||
# sure shot arrow functions even if => is on new line
|
||||
(
|
||||
(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
|
||||
|
@ -4014,7 +4014,7 @@
|
|||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(?<=[(=,]|=>)\s*(async)?(?=\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?\(\s*$)</string>
|
||||
<string>(?<=[(=,]|=>)\s*(async)?(?=\s*((((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?\()|(<))\s*$)</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
|
@ -4138,7 +4138,7 @@
|
|||
<key>name</key>
|
||||
<string>cast.expr.ts</string>
|
||||
<key>begin</key>
|
||||
<string>(?:(?<!\+\+|--)(?<=^return|[^\._$[:alnum:]]return|^throw|[^\._$[:alnum:]]throw|^yield|[^\._$[:alnum:]]yield|^await|[^\._$[:alnum:]]await|^default|[^\._$[:alnum:]]default|[=(,:>*?\&\|\^]|[^_$[:alnum:]](?:\+\+|\-\-)|[^\+]\+|[^\-]\-))\s*(<)(?!<?\=)</string>
|
||||
<string>(?:(?<!\+\+|--)(?<=^return|[^\._$[:alnum:]]return|^throw|[^\._$[:alnum:]]throw|^yield|[^\._$[:alnum:]]yield|^await|[^\._$[:alnum:]]await|^default|[^\._$[:alnum:]]default|[=(,:>*?\&\|\^]|[^_$[:alnum:]](?:\+\+|\-\-)|[^\+]\+|[^\-]\-))\s*(<)(?!<?\=)(?!\s*$)</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
|
@ -5186,7 +5186,7 @@
|
|||
([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
||||
)) |
|
||||
((async\s*)?(
|
||||
((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$) |
|
||||
((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
|
||||
# sure shot arrow functions even if => is on new line
|
||||
(
|
||||
(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
|
||||
|
@ -5935,7 +5935,7 @@
|
|||
))
|
||||
))
|
||||
)) |
|
||||
(:\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)))</string>
|
||||
(:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$))))</string>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
|
|
|
@ -9,7 +9,8 @@ fileTypes: [tsx]
|
|||
uuid: 805375ec-d614-41f5-8993-5843fe63ea82
|
||||
|
||||
variables:
|
||||
possiblyMultilineArrow: ([\(]\s*([\{\[]\s*)?$) # during lookup treat ( followed by line end as arrow
|
||||
#possiblyMultilineArrowExpressionBeforeEndOfLine: ({{typeParameters}})?\(
|
||||
possiblyMultilineArrow: ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) # during lookup treat ( followed by line end as arrow
|
||||
jsxTagOrAtrributeIdentifier: '[_$a-zA-Z][-$\w.]'
|
||||
jsxTagNamespace: (?:({{jsxTagOrAtrributeIdentifier}}*)(?<!\.|-)(:))?
|
||||
jsxTagName: \s*{{jsxTagNamespace}}((?:[a-z][a-z0-9]*|({{jsxTagOrAtrributeIdentifier}}*))(?<!\.|-))
|
||||
|
|
|
@ -502,7 +502,7 @@
|
|||
([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
||||
)) |
|
||||
((async\s*)?(
|
||||
([\(]\s*([\{\[]\s*)?$) |
|
||||
((<\s*$)|([\(]\s*([\{\[]\s*)?$)) |
|
||||
# sure shot arrow functions even if => is on new line
|
||||
(
|
||||
(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
|
||||
|
@ -536,7 +536,7 @@
|
|||
))
|
||||
))
|
||||
)) |
|
||||
(:\s*([\(]\s*([\{\[]\s*)?$)) |
|
||||
(:\s*((<\s*$)|([\(]\s*([\{\[]\s*)?$))) |
|
||||
(:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
|
||||
((async\s+)?(
|
||||
(function\s*[(<*]) |
|
||||
|
@ -544,7 +544,7 @@
|
|||
([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
||||
)) |
|
||||
((async\s*)?(
|
||||
([\(]\s*([\{\[]\s*)?$) |
|
||||
((<\s*$)|([\(]\s*([\{\[]\s*)?$)) |
|
||||
# sure shot arrow functions even if => is on new line
|
||||
(
|
||||
(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
|
||||
|
@ -948,7 +948,7 @@
|
|||
([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
||||
)) |
|
||||
((async\s*)?(
|
||||
([\(]\s*([\{\[]\s*)?$) |
|
||||
((<\s*$)|([\(]\s*([\{\[]\s*)?$)) |
|
||||
# sure shot arrow functions even if => is on new line
|
||||
(
|
||||
(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
|
||||
|
@ -982,7 +982,7 @@
|
|||
))
|
||||
))
|
||||
)) |
|
||||
(:\s*([\(]\s*([\{\[]\s*)?$)) |
|
||||
(:\s*((<\s*$)|([\(]\s*([\{\[]\s*)?$))) |
|
||||
(:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
|
||||
((async\s+)?(
|
||||
(function\s*[(<*]) |
|
||||
|
@ -990,7 +990,7 @@
|
|||
([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
||||
)) |
|
||||
((async\s*)?(
|
||||
([\(]\s*([\{\[]\s*)?$) |
|
||||
((<\s*$)|([\(]\s*([\{\[]\s*)?$)) |
|
||||
# sure shot arrow functions even if => is on new line
|
||||
(
|
||||
(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
|
||||
|
@ -1417,7 +1417,7 @@
|
|||
([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
||||
)) |
|
||||
((async\s*)?(
|
||||
([\(]\s*([\{\[]\s*)?$) |
|
||||
((<\s*$)|([\(]\s*([\{\[]\s*)?$)) |
|
||||
# sure shot arrow functions even if => is on new line
|
||||
(
|
||||
(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
|
||||
|
@ -1451,7 +1451,7 @@
|
|||
))
|
||||
))
|
||||
)) |
|
||||
(:\s*([\(]\s*([\{\[]\s*)?$)) |
|
||||
(:\s*((<\s*$)|([\(]\s*([\{\[]\s*)?$))) |
|
||||
(:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
|
||||
((async\s+)?(
|
||||
(function\s*[(<*]) |
|
||||
|
@ -1459,7 +1459,7 @@
|
|||
([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
||||
)) |
|
||||
((async\s*)?(
|
||||
([\(]\s*([\{\[]\s*)?$) |
|
||||
((<\s*$)|([\(]\s*([\{\[]\s*)?$)) |
|
||||
# sure shot arrow functions even if => is on new line
|
||||
(
|
||||
(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
|
||||
|
@ -3625,7 +3625,7 @@
|
|||
([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
||||
)) |
|
||||
((async\s*)?(
|
||||
([\(]\s*([\{\[]\s*)?$) |
|
||||
((<\s*$)|([\(]\s*([\{\[]\s*)?$)) |
|
||||
# sure shot arrow functions even if => is on new line
|
||||
(
|
||||
(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
|
||||
|
@ -4018,7 +4018,7 @@
|
|||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(?<=[(=,]|=>)\s*(async)?(?=\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?\(\s*$)</string>
|
||||
<string>(?<=[(=,]|=>)\s*(async)?(?=\s*((((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?\()|(<))\s*$)</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
|
@ -5132,7 +5132,7 @@
|
|||
([_$[:alpha:]][_$[:alnum:]]*\s*=>)
|
||||
)) |
|
||||
((async\s*)?(
|
||||
([\(]\s*([\{\[]\s*)?$) |
|
||||
((<\s*$)|([\(]\s*([\{\[]\s*)?$)) |
|
||||
# sure shot arrow functions even if => is on new line
|
||||
(
|
||||
(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
|
||||
|
@ -5881,7 +5881,7 @@
|
|||
))
|
||||
))
|
||||
)) |
|
||||
(:\s*([\(]\s*([\{\[]\s*)?$)))</string>
|
||||
(:\s*((<\s*$)|([\(]\s*([\{\[]\s*)?$))))</string>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
|
|
|
@ -0,0 +1,296 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
interface I {}
|
||||
|
||||
const goodHighlighting = <T extends I>(
|
||||
arg: T
|
||||
) => {
|
||||
const a = arg
|
||||
return a
|
||||
}
|
||||
|
||||
const goodHighlighting2 = <
|
||||
T
|
||||
>(
|
||||
arg: T
|
||||
) => {
|
||||
const a = arg
|
||||
return a
|
||||
}
|
||||
|
||||
const badHighlighting = <
|
||||
T extends I,
|
||||
>(
|
||||
arg: T
|
||||
) => {
|
||||
const a = arg
|
||||
return a
|
||||
}
|
||||
-----------------------------------
|
||||
|
||||
Grammar: TypeScript.tmLanguage
|
||||
-----------------------------------
|
||||
>interface I {}
|
||||
^^^^^^^^^
|
||||
source.ts meta.interface.ts storage.type.interface.ts
|
||||
^
|
||||
source.ts meta.interface.ts
|
||||
^
|
||||
source.ts meta.interface.ts entity.name.type.interface.ts
|
||||
^
|
||||
source.ts meta.interface.ts
|
||||
^
|
||||
source.ts meta.interface.ts punctuation.definition.block.ts
|
||||
^
|
||||
source.ts meta.interface.ts punctuation.definition.block.ts
|
||||
>
|
||||
^
|
||||
source.ts
|
||||
>const goodHighlighting = <T extends I>(
|
||||
^^^^^
|
||||
source.ts meta.var.expr.ts storage.type.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts
|
||||
^^^^^^^^^^^^^^^^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts entity.name.function.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts keyword.operator.assignment.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.type.parameters.ts entity.name.type.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.type.parameters.ts
|
||||
^^^^^^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.type.parameters.ts storage.modifier.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.type.parameters.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.type.parameters.ts entity.name.type.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
|
||||
> arg: T
|
||||
^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.parameters.ts
|
||||
^^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.parameters.ts variable.parameter.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.parameters.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.parameters.ts meta.type.annotation.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.parameters.ts meta.type.annotation.ts entity.name.type.ts
|
||||
>) => {
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.parameters.ts punctuation.definition.parameters.end.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts
|
||||
^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts storage.type.function.arrow.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts punctuation.definition.block.ts
|
||||
> const a = arg
|
||||
^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts
|
||||
^^^^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts storage.type.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.readwrite.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts keyword.operator.assignment.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts
|
||||
^^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts variable.other.readwrite.ts
|
||||
> return a
|
||||
^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts
|
||||
^^^^^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts keyword.control.flow.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts variable.other.readwrite.ts
|
||||
>}
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts punctuation.definition.block.ts
|
||||
>
|
||||
^
|
||||
source.ts
|
||||
>const goodHighlighting2 = <
|
||||
^^^^^
|
||||
source.ts meta.var.expr.ts storage.type.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts
|
||||
^^^^^^^^^^^^^^^^^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts entity.name.function.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts keyword.operator.assignment.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
|
||||
> T
|
||||
^^
|
||||
source.ts meta.var.expr.ts meta.type.parameters.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.type.parameters.ts entity.name.type.ts
|
||||
>>(
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.brace.round.ts
|
||||
> arg: T
|
||||
^^
|
||||
source.ts meta.var.expr.ts
|
||||
^^^
|
||||
source.ts meta.var.expr.ts variable.parameter.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.type.annotation.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.type.annotation.ts entity.name.type.ts
|
||||
>) => {
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.brace.round.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts
|
||||
^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts storage.type.function.arrow.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts punctuation.definition.block.ts
|
||||
> const a = arg
|
||||
^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts
|
||||
^^^^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts storage.type.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.readwrite.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts keyword.operator.assignment.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts
|
||||
^^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts variable.other.readwrite.ts
|
||||
> return a
|
||||
^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts
|
||||
^^^^^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts keyword.control.flow.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts variable.other.readwrite.ts
|
||||
>}
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts punctuation.definition.block.ts
|
||||
>
|
||||
^
|
||||
source.ts
|
||||
>const badHighlighting = <
|
||||
^^^^^
|
||||
source.ts meta.var.expr.ts storage.type.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts
|
||||
^^^^^^^^^^^^^^^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts entity.name.function.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts keyword.operator.assignment.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
|
||||
> T extends I,
|
||||
^^
|
||||
source.ts meta.var.expr.ts meta.type.parameters.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.type.parameters.ts entity.name.type.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.type.parameters.ts
|
||||
^^^^^^^
|
||||
source.ts meta.var.expr.ts meta.type.parameters.ts storage.modifier.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.type.parameters.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.type.parameters.ts entity.name.type.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.type.parameters.ts punctuation.separator.comma.ts
|
||||
>>(
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.brace.round.ts
|
||||
> arg: T
|
||||
^^
|
||||
source.ts meta.var.expr.ts
|
||||
^^^
|
||||
source.ts meta.var.expr.ts variable.parameter.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.type.annotation.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.type.annotation.ts entity.name.type.ts
|
||||
>) => {
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.brace.round.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts
|
||||
^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts storage.type.function.arrow.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts punctuation.definition.block.ts
|
||||
> const a = arg
|
||||
^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts
|
||||
^^^^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts storage.type.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.readwrite.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts keyword.operator.assignment.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts
|
||||
^^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts meta.var.expr.ts variable.other.readwrite.ts
|
||||
> return a
|
||||
^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts
|
||||
^^^^^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts keyword.control.flow.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts variable.other.readwrite.ts
|
||||
>}
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.block.ts punctuation.definition.block.ts
|
|
@ -0,0 +1,26 @@
|
|||
interface I {}
|
||||
|
||||
const goodHighlighting = <T extends I>(
|
||||
arg: T
|
||||
) => {
|
||||
const a = arg
|
||||
return a
|
||||
}
|
||||
|
||||
const goodHighlighting2 = <
|
||||
T
|
||||
>(
|
||||
arg: T
|
||||
) => {
|
||||
const a = arg
|
||||
return a
|
||||
}
|
||||
|
||||
const badHighlighting = <
|
||||
T extends I,
|
||||
>(
|
||||
arg: T
|
||||
) => {
|
||||
const a = arg
|
||||
return a
|
||||
}
|
Загрузка…
Ссылка в новой задаче