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

Conflict with Highlight extension? #16

Closed Geobert closed 5 years ago

Geobert commented 5 years ago

I'm not sure where the issue is, but I'm trying to use another extension: https://marketplace.visualstudio.com/items?itemName=fabiospampinato.vscode-highlight

And I want to hightlight the word TODO in a comment using this settings:

"highlight.regexes": {
        "(// ?)(TODO:?).*": {
            "filterLanguageRegex": "rust|^C.?.?",
            "decorations": [
                {},
                {
                    "fontWeight": "bold",
                    "overviewRulerColor": "#e5c07b",
                    "color": "#ffffff",
                },
            ],
        },
    },

I got my bold but not my colour (white), it seems to be overridden by syntax-highlighter

Is there a way to define an order in the highlighters?

It used to work with the default syntax highlighter

EvgeniyPeshkov commented 5 years ago

Hello @Geobert , welcome back (=. I've looked through vscode-highlight sources. It uses the same Decoration API as {Syntax Highlighter}. Then I've reviewed Decoration API itself one more time. There is no option to define priority of supplied decorations, or order of their application. If there was such an option, I would be glad to expose a setting. I'm afraid there is nothing I can do for now.

Geobert commented 5 years ago

Ok, I'll close this and open an issue in vscode :) Thanks for looking this up :)

EvgeniyPeshkov commented 5 years ago

You're welcome (=.

Geobert commented 5 years ago

for reference: https://github.com/microsoft/vscode/issues/74692

EvgeniyPeshkov commented 5 years ago

Hello, @Geobert , meanwhile I've found solution for this issue (=. I'll make a setting that disables {Syntax Highlighter} on comments. Then comments will be highlighter using standard tools, and other extensions could do whatever they want. It's also quite reasonable, because there are utilities to write documentation within comments like Doxygen or Sphinx. And there can be special extensions. that provide more extensive highlighting of in-comments documentation. I will reopen the issue and we will close it ones again when setting is ready (=.

EvgeniyPeshkov commented 5 years ago

syntax.highlightComment setting is available in the latest version. If you set it to false, {Syntax Highlighter} will skip colorization of comments and will not interfere with other extensions.

Geobert commented 5 years ago

it works :D Thanks! (had to restart VScode to make it work)