renpy / vscode-language-renpy

Ren'Py extension for Visual Studio Code
Other
105 stars 22 forks source link

[Enhancement] - Avoiding putting Textmate Scopes in local settings.json #196

Open multimokia opened 2 years ago

multimokia commented 2 years ago

Looking at VSCode's Markdown extension, I notice that the same behaviour with highlighting, underlining, italics, and bold etc. are all accomplished without modifying the user's local settings json

Is this possible to accomplish here as well? It'd be great to not have the extension needing to depend on whatever's in the settings json to make some of its richer highlighting features.

duckdoom4 commented 2 years ago

That would be great, so far I've not discovered a way to do this yet. But I can definitely take a look at the markdown extension, to see how that's done.

I do have to note that markdown is most likely added by the theme, and we can't directly modify or add to the current theme. The only way I found, is this round about way of adding custom text mate scopes.

multimokia commented 2 years ago

I found this: https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide#custom-textmate-scope-mappings

It seems to be a way to do what you're doing without modifying a user's settings. As well, it seems like the extension would likely benefit from a semanticTokenProvider given the existence of a tokenizer (and thus helping to improve python handling)