EvgeniyPeshkov / syntax-highlighter

Syntax Highlighter extension for Visual Studio Code (VSCode). Based on Tree-sitter.
https://marketplace.visualstudio.com/items?itemName=evgeniypeshkov.syntax-highlighter
MIT License
208 stars 44 forks source link

Suddenly it does not work anymore #55

Closed jeroenvanrensen closed 3 years ago

jeroenvanrensen commented 3 years ago

I'm using this plugin and I really like it.

But suddenly it didn't work anymore. I uninstalled and installed it but nothing changed.

What can I do about this?

EvgeniyPeshkov commented 3 years ago

Hello @JeroenvanRensen ! In the latest version, I've switched to Semantic Token API. Now Syntax Highlighter uses current theme colors out-of-box. You can refer this section of the docs. Kindly check that semantic highlighting is enabled in your settings.json using any of these methods:

"editor.semanticHighlighting.enabled": true,
"editor.semanticTokenColorCustomizations": {
    "enabled": true,
    "[Material Theme High Contrast]": {
        "enabled": true,
    }
},

If you use Syntax Highlighter for C++ I would recommend also disable enhanced C++ colorizations "C_Cpp.enhancedColorization": "Disabled,". Otherwise, two highlighting systems may interfere.

jeroenvanrensen commented 3 years ago

Hi @EvgeniyPeshkov,

Thank you very much for your quick and detailed answer.

I currently use the settings as mentioned below, but they aren't 100% the old color settings. Do you have an array for those settings?

However, thank you very much for this great plugin!

Jeroen

"editor.semanticTokenColorCustomizations": {
    "enabled": true,
    "[Default Dark+]": {
        "enabled": true,
        "rules": {
            "type":  "#26A69A",
            "namespace": "#00897B",
            "function": "#00BCD4",
            "variable": "#42A5F5",
            "number": "#90A4AE",
            "string": {
                "foreground": "#90A4AE",
                "italic": true
            },
            "comment": {
                "foreground": "#546E7A",
                "fontStyle": "italic"
            },
            "variable.readonly.defaultLibrary": "#A89F9B",
            "macro": "#7E57C2",
            "keyword": "#7986CB",
            "operator": "#9575CD",
            "type.modification": "#00897B",
            "punctuation": "#A1887F"
        }
    }
}
EvgeniyPeshkov commented 3 years ago

Hi @JeroenvanRensen ! Sorry for the delay. Here is the config I use to make colors exactly like they were before:

"editor.semanticHighlighting.enabled": true,
"editor.semanticTokenColorCustomizations": {
    "enabled": true,
    "[Current Theme]": {
        "enabled": true,
        "rules": {
            "type": "#26A69A",
            "namespace": "#00897B",
            "function": "#00BCD4",
            "variable": "#42A5F5",
            "number": "#90A4AE",
            "string": "#90A4AE",
            "comment": "#546E7A",
            "variable.readonly.defaultLibrary": "#A89F9B",
            "macro": "#7E57C2",
            "keyword": "#7986CB",
            "operator": "#9575CD",
            "type.modification": "#00897B",
            "punctuation": "#A1887F"
        }
    }
},
jeroenvanrensen commented 3 years ago

@EvgeniyPeshkov Thank you very much!