sonph / onehalf

Clean, vibrant and pleasing color schemes for Vim, Sublime Text, iTerm, gnome-terminal and more.
MIT License
1.78k stars 236 forks source link

Two issues with highlighting of types in VS Code #83

Open rchoudhary opened 4 years ago

rchoudhary commented 4 years ago

Here is a snippet of C++ code colored with OneHalf Light in VS Code:

Screen Shot 2020-06-26 at 5 52 08 PM

ISSUE 1: By default, OneHalf Light colors class names, but not struct names. Both are colored perfectly fine in Sublime Text 3 however:

Screen Shot 2020-06-26 at 5 51 29 PM

Note that the Sublime Text theme file uses support.class, entity.name.class, entity.name.type.class in its definitions. In VS Code however, none of these work for structs, you need to use entity.name.type.struct; Note that entity.name.struct doesn't work either.

Anyways I added the following to my VS Code settings:

    "editor.tokenColorCustomizations": {
        "[onehalf-light]": {
            "textMateRules": [
                {
                    "scope": "entity.name.type.struct",
                    "settings": {
                        "foreground": "#FF0000",
                        "fontStyle": "italic bold underline"
                    }
                }
            ]
        }
    },

This is what it now looks like in VS Code:

Screen Shot 2020-06-26 at 5 52 24 PM

ISSUE 2: The types of both b and c remain uncolored.

Here is how the code looks with the default VS Code Light+ syntax coloring:

Screen Shot 2020-06-26 at 5 51 18 PM

The semantic coloring seems to work in that case.

rchoudhary commented 4 years ago

I should add that in my settings I have both

    "C_Cpp.enhancedColorization": "Enabled",
    "editor.semanticTokenColorCustomizations": {
        "enabled": true
    },

I also have both the C/C++ extension by Microsoft as well as the Better C++ Syntax extension by Jeff Hykin installed and enabled.