Closed Darkness2k19 closed 7 months ago
Clangd does not apply semantic highlighting to keyword tokens in general, leaving that to client-side highlighting.
Is the apperance of char
any different in this static_assert
than on the line:
char c;
?
Yes, it differs
I supposed there was something with c++ version that is used to parse tokens and to highlight them because, if I change is_assignable_v
to is_assignable
or even just add a trailing ::
, the char
becomes properly highlighted
but in that case clangd would not find the is_assignable_v
itself so I thought it might be either a clangd extension bug or a problem of vscode itself
It's an issue of vscode's client-side highlighting, please file it at https://github.com/jeff-hykin/better-cpp-syntax.
You can also consider using Minimal C++ Syntax as an alternative client-side highlighting engine to VSCode's default, it does not have this problem.
Thank you very much for your help, this issue is then resolved!
char
is not highlighted as if it was not parsed as a valid tokenconst std::string sc(1, 'a');
static_assert(!std::is_assignable_v<decltype(*sc.data()), char>);
Logs Initialization clangd.log
On hower over
char
I[01:56:57.013] <-- textDocument/hover(19) V[01:56:57.014] ASTWorker running Hover on version 1 of /home/darknessx/Projects/CPP/Programming/review/string/main.cpp I[01:56:57.016] --> reply:textDocument/hover(19) 2 ms V[01:56:57.016] >>> {"id":19,"jsonrpc":"2.0","result":null}System information Clangd version: 16.0.2 clangd extension version: 0.1.24 Operating system: Ubuntu 22.04.3 LTS