diff --git a/TypeScript.YAML-tmLanguage b/TypeScript.YAML-tmLanguage index 6ad89bf3..d8dfdfe2 100644 --- a/TypeScript.YAML-tmLanguage +++ b/TypeScript.YAML-tmLanguage @@ -77,6 +77,11 @@ repository: - include: '#type-annotation' - include: '#string' - include: '#comment' + - name: meta.var-single-variable.expr.ts + begin: ([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]]) + beginCaptures: + '1': { name: meta.definition.variable.ts variable.other.constant.ts } + end: (?=$|[;,=}]|(\s+(of|in)\s+)) - name: meta.var-single-variable.expr.ts begin: ([_$[:alpha:]][_$[:alnum:]]*) beginCaptures: @@ -1397,7 +1402,7 @@ repository: )(?=\s*\.\s*[_$[:alpha:]][_$[:alnum:]]*) captures: '1': { name: punctuation.accessor.ts } - '2': { name: constant.other.object.property.ts } + '2': { name: variable.other.constant.object.property.ts } '3': { name: variable.other.object.property.ts } # function and method assignment - match: |- @@ -1412,7 +1417,7 @@ repository: - match: (\.)\s*([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]]) captures: '1': { name: punctuation.accessor.ts } - '2': { name: constant.other.property.ts } + '2': { name: variable.other.constant.property.ts } # properties - match: (\.)\s*([_$[:alpha:]][_$[:alnum:]]*) captures: @@ -1425,10 +1430,10 @@ repository: ([_$[:alpha:]][_$[:alnum:]]*) )(?=\s*\.\s*[_$[:alpha:]][_$[:alnum:]]*) captures: - '1': { name: constant.other.object.ts } + '1': { name: variable.other.constant.object.ts } '2': { name: variable.other.object.ts } # const - - name: constant.other.ts + - name: variable.other.constant.ts match: ([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]]) # vars - name: variable.other.readwrite.ts diff --git a/TypeScript.tmLanguage b/TypeScript.tmLanguage index f5c893c3..ea2d24f8 100644 --- a/TypeScript.tmLanguage +++ b/TypeScript.tmLanguage @@ -192,6 +192,22 @@ + + name + meta.var-single-variable.expr.ts + begin + ([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]]) + beginCaptures + + 1 + + name + meta.definition.variable.ts variable.other.constant.ts + + + end + (?=$|[;,=}]|(\s+(of|in)\s+)) + name meta.var-single-variable.expr.ts @@ -3868,7 +3884,7 @@ 2 name - constant.other.object.property.ts + variable.other.constant.object.property.ts 3 @@ -3910,7 +3926,7 @@ 2 name - constant.other.property.ts + variable.other.constant.property.ts @@ -3942,7 +3958,7 @@ 1 name - constant.other.object.ts + variable.other.constant.object.ts 2 @@ -3953,7 +3969,7 @@ name - constant.other.ts + variable.other.constant.ts match ([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]]) diff --git a/TypeScriptReact.tmLanguage b/TypeScriptReact.tmLanguage index e4eca8dc..75a1886b 100644 --- a/TypeScriptReact.tmLanguage +++ b/TypeScriptReact.tmLanguage @@ -192,6 +192,22 @@ + + name + meta.var-single-variable.expr.tsx + begin + ([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]]) + beginCaptures + + 1 + + name + meta.definition.variable.tsx variable.other.constant.tsx + + + end + (?=$|[;,=}]|(\s+(of|in)\s+)) + name meta.var-single-variable.expr.tsx @@ -3872,7 +3888,7 @@ 2 name - constant.other.object.property.tsx + variable.other.constant.object.property.tsx 3 @@ -3914,7 +3930,7 @@ 2 name - constant.other.property.tsx + variable.other.constant.property.tsx @@ -3946,7 +3962,7 @@ 1 name - constant.other.object.tsx + variable.other.constant.object.tsx 2 @@ -3957,7 +3973,7 @@ name - constant.other.tsx + variable.other.constant.tsx match ([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]]) diff --git a/tests/baselines/Issue10.baseline.txt b/tests/baselines/Issue10.baseline.txt index b0ab0791..94c1110d 100644 --- a/tests/baselines/Issue10.baseline.txt +++ b/tests/baselines/Issue10.baseline.txt @@ -149,7 +149,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.array.literal.ts punctuation.accessor.ts ^ - source.ts meta.class.ts meta.method.declaration.ts meta.array.literal.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.array.literal.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.array.literal.ts meta.brace.square.ts ^ diff --git a/tests/baselines/Issue124.baseline.txt b/tests/baselines/Issue124.baseline.txt index 89edf208..412f3bc5 100644 --- a/tests/baselines/Issue124.baseline.txt +++ b/tests/baselines/Issue124.baseline.txt @@ -151,7 +151,7 @@ Grammar: TypeScript.tmLanguage ^^ source.ts meta.var.expr.ts string.template.ts meta.template.expression.ts punctuation.definition.template-expression.begin.ts ^^^^^^^^^^^^^^^^^^^^ - source.ts meta.var.expr.ts string.template.ts meta.template.expression.ts constant.other.ts + source.ts meta.var.expr.ts string.template.ts meta.template.expression.ts variable.other.constant.ts ^ source.ts meta.var.expr.ts string.template.ts meta.template.expression.ts punctuation.definition.template-expression.end.ts ^^ diff --git a/tests/baselines/Issue153.baseline.txt b/tests/baselines/Issue153.baseline.txt index 45e0a160..ca639e46 100644 --- a/tests/baselines/Issue153.baseline.txt +++ b/tests/baselines/Issue153.baseline.txt @@ -471,7 +471,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.accessor.ts ^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.separator.comma.ts ^ @@ -481,7 +481,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.accessor.ts ^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.separator.comma.ts ^ @@ -491,7 +491,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.accessor.ts ^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts meta.brace.round.ts ^ @@ -553,7 +553,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.accessor.ts ^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.separator.comma.ts ^ @@ -563,7 +563,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.accessor.ts ^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.separator.comma.ts ^ @@ -573,7 +573,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.accessor.ts ^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts meta.brace.round.ts ^ @@ -635,7 +635,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.accessor.ts ^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.separator.comma.ts ^ @@ -645,7 +645,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.accessor.ts ^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.separator.comma.ts ^ @@ -655,7 +655,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.accessor.ts ^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts meta.brace.round.ts ^ @@ -863,7 +863,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.accessor.ts ^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.separator.comma.ts ^ @@ -873,7 +873,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.accessor.ts ^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.separator.comma.ts ^ @@ -883,7 +883,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.accessor.ts ^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts meta.brace.round.ts ^ @@ -945,7 +945,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.accessor.ts ^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.separator.comma.ts ^ @@ -955,7 +955,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.accessor.ts ^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.separator.comma.ts ^ @@ -965,7 +965,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.accessor.ts ^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts meta.brace.round.ts ^ @@ -1027,7 +1027,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.accessor.ts ^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.separator.comma.ts ^ @@ -1037,7 +1037,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.accessor.ts ^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.separator.comma.ts ^ @@ -1047,7 +1047,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts punctuation.accessor.ts ^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts new.expr.ts meta.brace.round.ts ^ diff --git a/tests/baselines/Issue191.baseline.txt b/tests/baselines/Issue191.baseline.txt index 834f1b51..35d4bd13 100644 --- a/tests/baselines/Issue191.baseline.txt +++ b/tests/baselines/Issue191.baseline.txt @@ -74,7 +74,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.var.expr.ts ^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.var.expr.ts constant.other.object.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.var.expr.ts variable.other.constant.object.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.var.expr.ts punctuation.accessor.ts ^^^^^ @@ -282,7 +282,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.var.expr.ts ^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.var.expr.ts constant.other.object.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.var.expr.ts variable.other.constant.object.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.var.expr.ts punctuation.accessor.ts ^^^^^ diff --git a/tests/baselines/Issue321.baseline.txt b/tests/baselines/Issue321.baseline.txt index e7e8f42f..3f4820eb 100644 --- a/tests/baselines/Issue321.baseline.txt +++ b/tests/baselines/Issue321.baseline.txt @@ -432,7 +432,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts meta.block.ts meta.arrow.ts meta.block.ts meta.var.expr.ts punctuation.accessor.ts ^^^^^^^^^^^^^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts meta.block.ts meta.arrow.ts meta.block.ts meta.var.expr.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts meta.block.ts meta.arrow.ts meta.block.ts meta.var.expr.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts meta.block.ts meta.arrow.ts meta.block.ts punctuation.terminator.statement.ts ^^ @@ -471,7 +471,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts meta.block.ts meta.arrow.ts meta.block.ts punctuation.accessor.ts ^^^^^^^^^^^^^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts meta.block.ts meta.arrow.ts meta.block.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts meta.block.ts meta.arrow.ts meta.block.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts meta.block.ts meta.arrow.ts meta.block.ts meta.brace.round.ts ^ @@ -496,7 +496,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts meta.block.ts meta.arrow.ts meta.block.ts meta.block.ts punctuation.accessor.ts ^^^^^^^^^^^^^^^ - source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts meta.block.ts meta.arrow.ts meta.block.ts meta.block.ts constant.other.property.ts + source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts meta.block.ts meta.arrow.ts meta.block.ts meta.block.ts variable.other.constant.property.ts ^ source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts meta.block.ts meta.arrow.ts meta.block.ts meta.block.ts punctuation.terminator.statement.ts ^^ diff --git a/tests/baselines/Issue346.baseline.txt b/tests/baselines/Issue346.baseline.txt index 37a19ed3..511b8145 100644 --- a/tests/baselines/Issue346.baseline.txt +++ b/tests/baselines/Issue346.baseline.txt @@ -78,7 +78,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.function.ts meta.block.ts meta.var.expr.ts ^^^^^^ - source.ts meta.function.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.function.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.constant.ts ^ source.ts meta.function.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts ^ @@ -279,7 +279,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.function.ts meta.block.ts meta.function.ts meta.block.ts meta.brace.round.ts ^^^^^^ - source.ts meta.function.ts meta.block.ts meta.function.ts meta.block.ts constant.other.ts + source.ts meta.function.ts meta.block.ts meta.function.ts meta.block.ts variable.other.constant.ts ^ source.ts meta.function.ts meta.block.ts meta.function.ts meta.block.ts ^ @@ -472,7 +472,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.var.expr.ts new.expr.ts meta.brace.round.ts ^^^ - source.ts meta.var.expr.ts new.expr.ts constant.other.object.ts + source.ts meta.var.expr.ts new.expr.ts variable.other.constant.object.ts ^ source.ts meta.var.expr.ts new.expr.ts punctuation.accessor.ts ^^^^^^^^^^^^^^^ diff --git a/tests/baselines/Issue368.baseline.txt b/tests/baselines/Issue368.baseline.txt new file mode 100644 index 00000000..d08e09b0 --- /dev/null +++ b/tests/baselines/Issue368.baseline.txt @@ -0,0 +1,112 @@ +original file +----------------------------------- +let creditCard = 'cc'; +const CREDIT_CARD = 'CC'; + +console.log(`Payment Type: ${creditCard}`); +console.log(`Payment Type: ${CREDIT_CARD}`); +----------------------------------- + +Grammar: TypeScript.tmLanguage +----------------------------------- +>let creditCard = 'cc'; + ^^^ + 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 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 string.quoted.single.ts punctuation.definition.string.begin.ts + ^^ + source.ts meta.var.expr.ts string.quoted.single.ts + ^ + source.ts meta.var.expr.ts string.quoted.single.ts punctuation.definition.string.end.ts + ^ + source.ts punctuation.terminator.statement.ts + ^^ + source.ts +>const CREDIT_CARD = 'CC'; + ^^^^^ + 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.constant.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 string.quoted.single.ts punctuation.definition.string.begin.ts + ^^ + source.ts meta.var.expr.ts string.quoted.single.ts + ^ + source.ts meta.var.expr.ts string.quoted.single.ts punctuation.definition.string.end.ts + ^ + source.ts punctuation.terminator.statement.ts + ^^ + source.ts +> + ^^ + source.ts +>console.log(`Payment Type: ${creditCard}`); + ^^^^^^^ + source.ts support.class.console.ts + ^ + source.ts punctuation.accessor.ts + ^^^ + source.ts support.function.console.ts + ^ + source.ts meta.brace.round.ts + ^ + source.ts string.template.ts punctuation.definition.string.template.begin.ts + ^^^^^^^^^^^^^^ + source.ts string.template.ts + ^^ + source.ts string.template.ts meta.template.expression.ts punctuation.definition.template-expression.begin.ts + ^^^^^^^^^^ + source.ts string.template.ts meta.template.expression.ts variable.other.readwrite.ts + ^ + source.ts string.template.ts meta.template.expression.ts punctuation.definition.template-expression.end.ts + ^ + source.ts string.template.ts punctuation.definition.string.template.end.ts + ^ + source.ts meta.brace.round.ts + ^ + source.ts punctuation.terminator.statement.ts + ^^ + source.ts +>console.log(`Payment Type: ${CREDIT_CARD}`); + ^^^^^^^ + source.ts support.class.console.ts + ^ + source.ts punctuation.accessor.ts + ^^^ + source.ts support.function.console.ts + ^ + source.ts meta.brace.round.ts + ^ + source.ts string.template.ts punctuation.definition.string.template.begin.ts + ^^^^^^^^^^^^^^ + source.ts string.template.ts + ^^ + source.ts string.template.ts meta.template.expression.ts punctuation.definition.template-expression.begin.ts + ^^^^^^^^^^^ + source.ts string.template.ts meta.template.expression.ts variable.other.constant.ts + ^ + source.ts string.template.ts meta.template.expression.ts punctuation.definition.template-expression.end.ts + ^ + source.ts string.template.ts punctuation.definition.string.template.end.ts + ^ + source.ts meta.brace.round.ts + ^ + source.ts punctuation.terminator.statement.ts \ No newline at end of file diff --git a/tests/baselines/Issue37.baseline.txt b/tests/baselines/Issue37.baseline.txt index 550a1193..674bcbc7 100644 --- a/tests/baselines/Issue37.baseline.txt +++ b/tests/baselines/Issue37.baseline.txt @@ -478,7 +478,7 @@ Grammar: TypeScript.tmLanguage ^ source.ts meta.var.expr.ts ^ - source.ts meta.var.expr.ts constant.other.ts + source.ts meta.var.expr.ts variable.other.constant.ts ^ source.ts punctuation.terminator.statement.ts > diff --git a/tests/cases/Issue368.ts b/tests/cases/Issue368.ts new file mode 100644 index 00000000..5007c69b --- /dev/null +++ b/tests/cases/Issue368.ts @@ -0,0 +1,5 @@ +let creditCard = 'cc'; +const CREDIT_CARD = 'CC'; + +console.log(`Payment Type: ${creditCard}`); +console.log(`Payment Type: ${CREDIT_CARD}`); \ No newline at end of file