microsoft / vscode

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

Bug in syntax highlighting #53648

Closed PaVolDev closed 6 years ago

PaVolDev commented 6 years ago

Issue Type: Bug

Enter code: asd = "_string";

A string that contains the symbol underscore is highlighted as a number (Pink). Then, after this the semicolon is highlighted as a code error (Red) and all the code is incorrectly highlighted.

VS Code version: Code 1.25.0 (0f080e5267e829de46638128001aeb7ca2d6d50e, 2018-07-05T13:11:58.697Z) OS version: Windows_NT x64 10.0.15063

48645648 48645646 48645650

The sample code (C#):

using System.Collections;
public class GameSettings : MonoBehaviour {
    public string gameMode = "_none";
    public static int scores = 4568;
    public static int kills = 123456;
    public static int allMoney = 123456;
}

5464845

Extensions (5) Extension|Author (truncated)|Version ---|---|--- vs-color-picker|lih|0.7.0 identical-sublime-monokai-csharp-theme-colorizer|max|0.10.0 vscode-language-pack-ru|MS-|1.25.2 csharp|ms-|1.15.2 color-highlight|nau|2.3.0
jrieken commented 6 years ago

In what language does that happen?

PaVolDev commented 6 years ago

The programming language is C#

ivanvoznyakovsky commented 6 years ago

I got an issue w/ highlighting variable type in typescript

only first typed var is highlighted. the following two are not

screenshot 2018-07-06 14 32 38

breaking it apart highlights the first two but if you add types to the following vars it's not highlighted

screenshot 2018-07-06 14 36 35
aeschli commented 6 years ago

@PaVolDev Can you paste the sample code?

PaVolDev commented 6 years ago

@aeschli, The sample code (C#):

using System.Collections;
public class GameSettings : MonoBehaviour {
    public string gameMode = "_none";
    public static int scores = 4568;
    public static int kills = 123456;
    public static int allMoney = 123456;
}

5464845

The semicolon is highlighted as a code error (Red) and all the code is incorrectly highlighted

PaVolDev commented 6 years ago

It seems I found the problem. I have the installed extension "identical-sublime-monokai-csharp-theme-colorizer" v0.10.0. I disabled this extension and the problem disappeared. 5464846

aeschli commented 6 years ago

Thanks for finding the issue. Looks like this already reported here: https://github.com/Maximetinu/Sublime-Text-Monokai-theme-for-Visual-Studio-Code/issues/1