Closed tokyo4j closed 2 months ago
Clangd does not color the output in the hover. This is what clangd sends back to the client:
I[19:22:00.963] --> reply:textDocument/hover(505) 4 ms
V[19:22:00.963] >>> {
"id": 505,
"jsonrpc": "2.0",
"result": {
"contents": {
"kind": "markdown",
"value": "### function `main` \n\n---\n→ `int` \nParameters: \n- `int argc`\n- `const char ** argv`\n\n---\n```cpp\nint main(int argc, const char *argv[])\n```"
},
"range": {
"end": {
"character": 8,
"line": 2
},
"start": {
"character": 4,
"line": 2
}
}
}
}
Any coloring that appears is applied by the client.
In this case, it looks like vscode is applying its TextMate-based client-side highlighting to the code in the hover contents.
You can see the same effect in the editor itself:
int main(int argc, char const *argv[]) {}
main
, and observe the highlighting nowThis client-side highlighting is implemented in https://github.com/jeff-hykin/better-cpp-syntax, so you can file an issue there if you'd like. (But note that client-side highlighting is based on regexes and tends to be inaccurate in general, so I wouldn't have high expectations for it.)
When there's
AlwaysBreakAfterDefinitionReturnType: true
in.clang-format
, function signatures in hover widgets are not highlighted correctly.argc
andargv
are not highlighted)Logs
output when I open the workspace and hover the cursor over "main" in the picture above with {"clangd.arguments": ["--log=verbose"]}
System information Clangd version (from the log, or
clangd --version
): 17.0.6 clangd extension version: v0.1.28 Operating system: Arch Linux (AMD64)