Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TypeScript.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ variables:
lookBehindOfPossiblyMultilineArrow: (?<=[(=,]|=>|{{lookBehindReturn}})
lookBehindOfObjectMemberPossiblyMultilineArrow: (?<=:)
# Identifier start | matching braces | matching parenthesis | matching square brackets
typeParamersStart: (((const\s+)?[_$[:alpha:]])|{{matchingBraces}}|{{matchingParenthesis}}|{{matchingBrackets}})
typeParamersStart: (((const\s+)?[_$\'"[:alnum:]])|{{matchingBraces}}|{{matchingParenthesis}}|{{matchingBrackets}})
typeParameters: (<\s*{{typeParamersStart}}([^=<>]|=[^<]|\<\s*{{typeParamersStart}}([^=<>]|=[^<]|\<\s*{{typeParamersStart}}([^=<>]|=[^<])*\>)*\>)*>\s*)
# Identifier start | matching braces | matching parenthesis | matching square brackets | matching strings
typeArgumentsStart: (((keyof|infer|typeof|readonly)\s+)|(({{identifier}}|{{matchingBraces}}|{{matchingParenthesis}}|{{matchingBrackets}}|{{quotedStrings}})(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))
Expand Down
106 changes: 53 additions & 53 deletions TypeScript.tmLanguage

Large diffs are not rendered by default.

70 changes: 35 additions & 35 deletions TypeScriptReact.tmLanguage

Large diffs are not rendered by default.

176 changes: 176 additions & 0 deletions tests/baselines/Issue1035.baseline.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
original file
-----------------------------------
let var1;

interface MyInterface {
func1<T = Lowercase<'StringLiteral'>>(): T;
func2<T = Lowercase<"StringLiteral">>(): T;
func3<T = Lowercase<123>>(): T;
}

let var2;

-----------------------------------

Grammar: TypeScript.tmLanguage
-----------------------------------
>let var1;
^^^
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 variable.other.readwrite.ts
^
source.ts punctuation.terminator.statement.ts
>
^
source.ts
>interface MyInterface {
^^^^^^^^^
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
> func1<T = Lowercase<'StringLiteral'>>(): T;
^^
source.ts meta.interface.ts meta.method.declaration.ts
^^^^^
source.ts meta.interface.ts meta.method.declaration.ts meta.definition.method.ts entity.name.function.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts keyword.operator.assignment.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts
^^^^^^^^^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts string.quoted.single.ts punctuation.definition.string.begin.ts
^^^^^^^^^^^^^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts string.quoted.single.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts string.quoted.single.ts punctuation.definition.string.end.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.end.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.return.type.ts keyword.operator.type.annotation.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.return.type.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.return.type.ts entity.name.type.ts
^
source.ts meta.interface.ts punctuation.terminator.statement.ts
> func2<T = Lowercase<"StringLiteral">>(): T;
^^
source.ts meta.interface.ts meta.method.declaration.ts
^^^^^
source.ts meta.interface.ts meta.method.declaration.ts meta.definition.method.ts entity.name.function.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts keyword.operator.assignment.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts
^^^^^^^^^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts string.quoted.double.ts punctuation.definition.string.begin.ts
^^^^^^^^^^^^^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts string.quoted.double.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts string.quoted.double.ts punctuation.definition.string.end.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.end.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.return.type.ts keyword.operator.type.annotation.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.return.type.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.return.type.ts entity.name.type.ts
^
source.ts meta.interface.ts punctuation.terminator.statement.ts
> func3<T = Lowercase<123>>(): T;
^^
source.ts meta.interface.ts meta.method.declaration.ts
^^^^^
source.ts meta.interface.ts meta.method.declaration.ts meta.definition.method.ts entity.name.function.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts keyword.operator.assignment.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts
^^^^^^^^^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
^^^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts constant.numeric.decimal.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.end.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.return.type.ts keyword.operator.type.annotation.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.return.type.ts
^
source.ts meta.interface.ts meta.method.declaration.ts meta.return.type.ts entity.name.type.ts
^
source.ts meta.interface.ts punctuation.terminator.statement.ts
>}
^
source.ts meta.interface.ts punctuation.definition.block.ts
>
^
source.ts
>let var2;
^^^
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 variable.other.readwrite.ts
^
source.ts punctuation.terminator.statement.ts
>
^
source.ts
Loading