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
217 stars 43 forks source link

Overrides Rainbow Brackets #50

Closed ganzuul closed 4 years ago

ganzuul commented 4 years ago

Rainbow Brackets by 2gua colors pairs of e.g. parenthesis, which helps immensely with finding errors in nesting. And it looks pretty. When Syntax Highlighter is enabled it seems to override the stylesheet for brackets, clobbering the entire purpose of the other extension.

This happens with C/C++ but not with Python code, with and without Microsoft's C/C++ extension.

Removing

        "\";\"": "punctuation",
        "\":\"": "punctuation",
        "\",\"": "punctuation",
        "\"[\"": "punctuation",
        "\"]\"": "punctuation",
        "\"{\"": "punctuation",
        "\"}\"": "punctuation",
        "\"(\"": "punctuation",
        "\")\"": "punctuation"

from grammars/cpp.json seems to fix the problem.

EvgeniyPeshkov commented 4 years ago

Hello @ganzuul , This happens because both extensions use decoration API. And priority of decoration providers (order in which decorations are applied) cannot be defined. I recommend you to simply disable highlighting of punctuation tokens. There is special setting for this. Just put "syntax.highlightTerms": [...], in your settings.json and remove "punctuation" from the array of terms to highlight.