vscode-clangd icon indicating copy to clipboard operation
vscode-clangd copied to clipboard

Semantic highlighting is missing some tokens

Open colinfang opened this issue 2 years ago • 1 comments

See in screenshot

Syntax highlighting colors are not consistent. (Comparing A, int, decltype)

I checked in "Developer: Inspect Editor Token and Scopes", and notice not all types have "semantic token type"

image

System information Clangd version (from the log, or clangd --version): 15.0.0 clangd extension version: 0.1.16 Operating system: x86_64-pc-linux-gnu ubuntu 20.04 in WSL2

colinfang avatar Apr 29 '22 03:04 colinfang

Not having semantic tokens for primitive types is deliberate; since those are keywords, we generally expect them to be covered by client-side highlighting (though there is discussion in https://github.com/clangd/clangd/issues/1115 about supporting an option to have the server provide all tokens so there is no need for client-side highlighting).

However, the semantic tokens on the two decltype occurrences in the screenshot are unexpected; I would only expect decltype to get a semantic token if the deduced type is not primitive.

HighCommander4 avatar Apr 29 '22 03:04 HighCommander4