Skip to content

Commit

Permalink
Light/Dark Visual Studio theme needs improvements to handle expressio…
Browse files Browse the repository at this point in the history
…ns in template string. Fixes #13166
  • Loading branch information
aeschli committed Nov 7, 2016
1 parent 505d44f commit 5fb12f2
Show file tree
Hide file tree
Showing 6 changed files with 619 additions and 20 deletions.
7 changes: 7 additions & 0 deletions extensions/theme-defaults/themes/dark_vs.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,13 @@
"foreground": "#d16969"
}
},
{
"name": "JavaScript string interpolation ${}",
"scope": "string.template-expression",
"settings": {
"foreground": "#569cd6"
}
},
{
"scope": "support.type.property-name",
"settings": {
Expand Down
7 changes: 7 additions & 0 deletions extensions/theme-defaults/themes/hc_black.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@
"foreground": "#d16969"
}
},
{
"name": "JavaScript string interpolation ${}",
"scope": "string.template-expression",
"settings": {
"foreground": "#569cd6"
}
},
{
"scope": "support.type.property-name",
"settings": {
Expand Down
7 changes: 7 additions & 0 deletions extensions/theme-defaults/themes/light_vs.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,13 @@
"foreground": "#811f3f"
}
},
{
"name": "JavaScript string interpolation ${}",
"scope": "string.template-expression",
"settings": {
"foreground": "#0000ff"
}
},
{
"scope": "support.property-value",
"settings": {
Expand Down
4 changes: 4 additions & 0 deletions extensions/typescript/test/colorize-fixtures/test-strings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var x = `Hello ${foo}!`;
console.log(`string text line 1
string text line 2`);
x = tag`Hello ${ a + b } world ${ a * b }`;
40 changes: 20 additions & 20 deletions extensions/typescript/test/colorize-results/test-issue5431_ts.json
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,11 @@
"c": "${",
"t": "begin.block.definition.expr.expression.function.meta.punctuation.string.template.template-expression.ts.var",
"r": {
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)",
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)",
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)",
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)",
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)"
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string.template-expression rgb(86, 156, 214)",
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string.template-expression rgb(0, 0, 255)",
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string.template-expression rgb(86, 156, 214)",
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string.template-expression rgb(0, 0, 255)",
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string.template-expression rgb(86, 156, 214)"
}
},
{
Expand All @@ -377,11 +377,11 @@
"c": "}",
"t": "block.definition.end.expr.expression.function.meta.punctuation.string.template.template-expression.ts.var",
"r": {
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)",
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)",
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)",
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)",
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)"
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string.template-expression rgb(86, 156, 214)",
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string.template-expression rgb(0, 0, 255)",
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string.template-expression rgb(86, 156, 214)",
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string.template-expression rgb(0, 0, 255)",
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string.template-expression rgb(86, 156, 214)"
}
},
{
Expand All @@ -399,11 +399,11 @@
"c": "${",
"t": "begin.block.definition.expr.expression.function.meta.punctuation.string.template.template-expression.ts.var",
"r": {
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)",
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)",
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)",
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)",
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)"
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string.template-expression rgb(86, 156, 214)",
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string.template-expression rgb(0, 0, 255)",
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string.template-expression rgb(86, 156, 214)",
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string.template-expression rgb(0, 0, 255)",
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string.template-expression rgb(86, 156, 214)"
}
},
{
Expand All @@ -421,11 +421,11 @@
"c": "}",
"t": "block.definition.end.expr.expression.function.meta.punctuation.string.template.template-expression.ts.var",
"r": {
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)",
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)",
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)",
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)",
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)"
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string.template-expression rgb(86, 156, 214)",
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string.template-expression rgb(0, 0, 255)",
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string.template-expression rgb(86, 156, 214)",
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string.template-expression rgb(0, 0, 255)",
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string.template-expression rgb(86, 156, 214)"
}
},
{
Expand Down
Loading

0 comments on commit 5fb12f2

Please sign in to comment.