scalameta / metals-vscode

Visual Studio Code extension for Metals
https://marketplace.visualstudio.com/items?itemName=scalameta.metals#overview
Apache License 2.0
300 stars 76 forks source link

Some of the keywords in the highlight are the wrong color #1523

Open harry-xi opened 3 months ago

harry-xi commented 3 months ago

Describe the bug

Process control keywords such as if match for are represented by the semantic token type as other making them highlighted as normal keywords, which is not in line with the general habits of vscode users.

To Reproduce Steps to reproduce the behavior:

1.Open a scala file with this plugin enabled and enter any statement of this type in it.

Expected behavior

Keywords such as if match for should be tagged with keyword.control

Screenshots

image

Installation:

Search terms

tgodzik commented 3 months ago

Thanks for reporting! I think this might be a VS Code only modifier as LSP protocol doesn't declare it: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_semanticTokens

And the Scala syntax default scopes are non standard. You can turn off semantic highlighting and that should use the default textmate highlighting.

harry-xi commented 3 months ago

Thanks for reporting! I think this might be a VS Code only modifier as LSP protocol doesn't declare it: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_semanticTokens

And the Scala syntax default scopes are non standard. You can turn off semantic highlighting and that should use the default textmate highlighting.

I looked at some other languages and noticed the fact that these languages do not semantically highlight keywords such as if

image image

tgodzik commented 3 months ago

Interesting, that might actually be an option for non soft keywords, which are not easy to detect with the usual syntax highlight