microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.47k stars 28.97k forks source link

Weird code snippet corrupts color theme #36944

Closed AskYous closed 6 years ago

AskYous commented 6 years ago
Extension Author (truncated) Version
vscode-angular2-files ale 1.3.10
ng-template Ang 0.1.7
npm-intellisense chr 1.3.0
path-intellisense chr 1.4.2
bracket-pair-colorizer Coe 0.10.10
vscode-markdownlint Dav 0.11.0
vscode-eslint dba 1.4.0
python don 0.7.0
xml Dot 1.9.2
gitlens eam 5.7.1
EditorConfig Edi 0.11.1
tslint eg2 1.0.12
vscode-npm-script eg2 0.3.1
prettier-vscode esb 0.24.0
vscode-atom-javascript-snippet glu 0.2.1
beautify Hoo 1.1.1
docthis joe 0.5.0
angular-essentials joh 0.3.2
Angular2 joh 2.10.0
codeacejumper luc 1.1.5
MagicPython mag 1.0.12
theme-monokai-pro-vscode mon 1.1.2
easy-less mrc 1.4.5
vscode-scss mrm 0.6.2
atom-keybindings ms- 3.0.2
debugger-for-chrome msj 3.4.0
angular2-inline nat 0.0.17
material-icon-theme PKi 2.2.3
ejs-language-support Qas 0.0.1
vscode-icons rob 7.16.0
python tht 0.2.3
gitblame wad 2.2.0
blade-runner yuk 1.0.0

(22 theme extensions excluded)


The following typescript code corrupts the color theme in the file it's in:

image

Here is the code:

captivateLoaded = typeof (<AdobeCaptivateWindow>htmlElement.contentWindow).cpAPIInterface !== "undefined";
if(captivateLoaded) {
    captivateLoaded = true;
    clearInterval(intervalId);
    afterCaptivateLoaded();
}

Paste it into a TypeScript file and watch it corrupt the color theme of the rest of your code. I didn't have any TypeScript errors in these lines of code. The color corruption occurs starting from the if statement.

Reproduces without extensions: Yes

mjbvz commented 6 years ago

I can't repo this with your snippet

screen shot 2017-10-25 at 9 57 39 pm

Can you please share some more complete code.

Also please try this in VS Code insiders. There were a few bugs with the grammar in 1.17 that have since been fixed

vscodebot[bot] commented 6 years ago

This issue has been closed automatically because it needs more information and has not had recent activity. Please refer to our guidelines for filing issues. Thank you for your contributions.