I am trying to integrate clangd with VS Code using vscode-clangd extension, but I am having problem with configuring include paths...
I created additional config in VS Code settings:
"clangd.path": "path_to_clangd/bin/clangd",
"clangd.arguments": [
"-compile-commands-dir=path_to_commands/compile_commands.json"
]
but the extension reports lots of missing includes errors.
I have also tried:
"-compile-commands-dir=path_to_commands"
but this also didn't work.
Does anyone knows how to configure this extension at all? I am unable to find any documentation at this point.
Regards
Your path should be directory to compile_commands.json, not file, and you need to restart the clangd by the vscode-clangd extension
settings.json
{
"cmake.buildDirectory": "${workspaceFolder}/debug",
"clangd.arguments": [
"-background-index",
"-compile-commands-dir=debug"
],
}
Restart
❯ ps -Af | grep clangd
awei 285478 282126 0 10:42 ? 00:00:03 /opt/llvm-10.0.0/bin/clangd -background-index -compile-commands-dir=debug
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With