-
Notifications
You must be signed in to change notification settings - Fork 30.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
semanticTokenScopes produces wrgon mappin #94367
Comments
We have a set of default rules configured, and
You can overwrite that for rust, if you prefer:
|
Ah... Yeah, that explains the observed behavior. I wonder though, why default maps to keyword.control and not just to keyword? |
It comes from the built-in default themes where we differentiate between keywords ('if', 'function', ...) ('keyword.control') and operators ('and', 'not') ('keyword.operator'). So we basically interested in the color that a theme gives to the the first set. |
Hm, right, that makes sense. Textmate scopes are confusing,I hope we’ll transition to more consistent semantic selectors eventually. Thanks for the explanation! |
In textmate, keyword.control is used for all kinds of things; in fact, the default scope mapping for keyword is keyword.control! So let's add a less ambiguous controlFlow modifier See microsoft/vscode#94367
4353: Better mapping to TextMate scopes for keywords r=matklad a=matklad microsoft/vscode#94367 (comment) bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Version: 1.44.0-insider
Commit: 20b88fa
Date: 2020-04-01T08:29:34.507Z
Electron: 7.1.11
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Linux x64 4.19.113
Problem: I am developing an extension which takes advantage of semantic highlighting, and looks like
"semanticTokenScopes"
selector matching is broken. Specifically, my pluging defines the mapping like this:but somehow control styling is applied to all keywords, not only to control ones:
Note that I also use a "zero" textmate grammar for rust, to make sure that there's no interference wit tm, but the same bug is observable with default rust grammar as well.
Steps to Reproduce:
{ "rust-analyzer.highlighting.semanticTokens": true, "editor.semanticHighlighting.enabled": true, }
The text was updated successfully, but these errors were encountered: