[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 [1], 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?



Thanks,

Nate


[1] https://urldefense.proofpoint.com/v2/url?u=https-3A__microsoft.github.io_language-2Dserver-2Dprotocol_specification-23workspace-5FworkspaceFolders&d=DwIGaQ&c=yzoHOc_ZK-sxl-kfGNSEvlJYanssXN3q-lhj0sp26wE&r=NrrbvTHWa2Nbp_kAN0Hl1o3lM1WAwSes64uBjxjNhMc&m=3UUNsFK6ghiKTGux3Z82wzvtaN9kYaR6wH0VEXZR9IE&s=1tNBKXqGFUvcojx6wHOTOiDmJVswMHM9mDkgQ0N75mE&e=

_______________________________________________

clangd-dev mailing list

clangd-dev at lists.llvm.org<mailto:clangd-dev at lists.llvm.org>

https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_clangd-2Ddev&d=DwIGaQ&c=yzoHOc_ZK-sxl-kfGNSEvlJYanssXN3q-lhj0sp26wE&r=NrrbvTHWa2Nbp_kAN0Hl1o3lM1WAwSes64uBjxjNhMc&m=3UUNsFK6ghiKTGux3Z82wzvtaN9kYaR6wH0VEXZR9IE&s=B09jAJpVj5zXbw1qTsc1epKbC_60W6aAmXg3I6bF0y8&e=

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/clangd-dev/attachments/20190311/7ca94be7/attachment.html>


More information about the clangd-dev mailing list