vscode-theme-onedark
vscode-theme-onedark copied to clipboard
Color inconsistency when declaring variables with "const" in Javascript
This issue regards Javascript. As you can see from the screenshot posted below, it appears that in the original Atom theme when you are declaring a variable using "const", the variable name turns orange, instead of white, as it does when using "var" or "let". VS Code treats all variable declarations with the white color. Can you please make the variable names declared with "const" orange for Javascript in VS Code?
(Please ignore my stupid midnight naming conventions...)
Sample code
function createGetSetDOMElements() {
const aboutIntro = this.document.getElementById("shortAboutIntro");
if (aboutIntro) {
aboutIntro.setAttribute("style", "color: red");
}
}
Filename and Language selected
I am creating a standard Javascript file with the .js file extension.
VSCode and Atom Original theme Screenshot
VSCode theme Screenshot (left) and Atom Original theme Screenshot (right), focus your attention on the red rectangles I have drawn for your convenience:
Versions used
- VSCode version: 1.20.0
- Theme version: 2.1.0
Extra information
I have no other relevant plugins or extensions that are in conflict with the theme.
This has come up before (#76, #57), but VSCode unfortunately doesn't provide any scope that I can use to differentiate it from regular variables declaration.
To be more clear, these three lines:
var aboutIntro = this.document.getElementById("shortAboutIntro");
let aboutIntro = this.document.getElementById("shortAboutIntro");
const aboutIntro = this.document.getElementById("shortAboutIntro");
have the same scopes:
variable.other.readwrite.js
meta.definition.variable.js
meta.var-single-variable.expr.js
meta.var.expr.js
meta.block.js
meta.function.js
source.js
as you can see, there is no "const" scope.
Tracking this issue in TmLanguage (https://github.com/Microsoft/TypeScript-TmLanguage/issues/542).
It looks like this can finally be fixed, I'm reopening the issue so I can fix it on the next release.