[clangd-dev] Multi-project workflow via multiple CDBs
Doug Schaefer via clangd-dev
clangd-dev at lists.llvm.org
Mon Mar 11 08:13:41 PDT 2019
On Mon, 2019-03-11 at 02:13 +0000, Nathan Ridge via clangd-dev wrote:
Out of curiosity, though - if a client wanted to send all the CDBs upfront, to avoid the
requirement that you have to open a file from each project, would that be a reasonable
capability to add?
That seems doable. The way this currently works is:
- A CDB is "discovered" the first time we try to get the command for a file under its directory
- once a CDB is "discovered", the auto-index loads any index shards that exist for the CDB,
and starts indexing files that don't have an up-to-date shard
So we could add a custom command or a startup option to make clangd discover particular
CDBs (e.g. by looking for a compile command for dir/dummy.txt, and then throwing it away).
It has since come to my attention that the LSP has recently gained a new workspace/workspaceFolders request , which is a mechanism for the server to learn about multiple root folders in the workspace, for editors that support such things. This request is not currently implemented in clangd.
Do you think this would be a good fit for telling the server about multiple CDBs as well? We could implement this request, and as an extension, support an additional field in the WorkspaceFolder struct to specify the CDB path.
Hey Nate, just wondering how this would work in VS Code. I assume it already would send this message. I'm not sure we can override it to send the additional field. Would adding a separate request be more flexible?
clangd-dev mailing list
clangd-dev at lists.llvm.org<mailto:clangd-dev at lists.llvm.org>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the clangd-dev