Closed braindevices closed 1 month ago
Using a single process for the entire workspace is a deliberate design choice, as it allows things like navigation between a use of a symbol in one project, and its definition in a dependent project.
Note that this does not preclude using different compile_commands.json
files for different root directories. Clangd searches for compile_commands.json
in the ancestor directories of the source file being opened, so e.g. having a different compile_commands.json
file in each top-level subdirectory of the workspace should work out of the box.
There is a fork of vscode-clangd which has the process-per-project behaviour you describe, at https://github.com/eclipse-cdt-cloud/vscode-clangd.
Duplicate of https://github.com/clangd/vscode-clangd/issues/498
in most other IDE, the clangd is per project which allow us easily work with different llvm version, different libraries, etc.
We basically need the clangd to parse different compile_commands.json for different root dir. This is especially important for multiple projects or multiple roots workspace.
Currently implementation of clangd server only start single process for the entire workspace, which is wrong.