Glebs Ivanovskis
Glebs Ivanovskis
See https://github.com/clangd/vscode-clangd/issues/218#issuecomment-898869786
This sounds like a duplicate of #148, #158 and probably other issues. See https://github.com/clangd/vscode-clangd/issues/148#issuecomment-776965665 or https://github.com/clangd/vscode-clangd/issues/158#issuecomment-1064413770 for a way to keep `$gcc` problem matcher while using clangd.
Yes, [vscode-cpptools can compile, run, debug and whatnot](https://code.visualstudio.com/docs/languages/cpp#_build-hello-world) in addition to code comprehension (aka IntelliSense). But I don't think there is much value in re-implementing features already supported by vscode-cpptools....
> providing your own setting for this Such option already exists in `clangd`: ``` --compile-commands-dir= - Specify a path to look for compile_commands.json. If path is invalid, clangd will look...
@JohnDoe2991, I think you just need to configure a [build task](https://code.visualstudio.com/docs/editor/tasks) with [problem matcher](https://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher) (you can use `$gcc` if you have [Microsoft's C/C++ extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) installed) and simply launch it when...
> Microsoft's C/C++ extension is incompatible with this extension, so you cannot use the `$gcc` problem matcher shipped with it. You can disable its IntelliSense (I believe it is `"C_Cpp.intelliSenseEngine":...
Start `clangd` when a file of any type is opened if `compile_commands.json` is in a parent directory
It should be possible by amending https://github.com/clangd/vscode-clangd/blob/1e4307e7e3df1019b76f24b5ba09ee7da822ce38/package.json#L25-L34 with [`"workspaceContains:**/compile_commands.json"`](https://code.visualstudio.com/api/references/activation-events#workspaceContains) or similar.
Editor reload is required to make changes in compile_command.json take effect for already-open files
Another related issue is #6.
> I am not sure if we really have FAQ-like discussions in vscode-clangd repo (can't say that I've been following thoroughly, so happy to be proven wrong). Few examples of...
@rapgenic, I would love to see your work as a standalone extension, because `clang-tidy` and `clang-format` can be used independently of `clangd`.