<div dir="ltr">Hi Nathan,<div><br></div><div>Unless there are issues that would prevent auto-discovery from working, I think we should prefer it instead.<br></div><div>One strong reason is that auto-discovery would work regardless of the client support.</div><div><br></div><div>Even if we take workspace folders into account and load CDBs from those, I think it's not enough.</div><div>A workspace folder represents a path to a project open in the editor. However, one does not typically open</div><div>all of their dependencies in the same editor but would want to discover CDBs for those dependencies.</div><div><br></div><div>+1 to Doug's suggestion, if we there's a client that has a legitimate need to send all CDBs upfront, let's extend LSP</div><div>to allow this instead of assigning our own semantics to the existing methods.</div><div><br></div><div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 11, 2019 at 3:13 AM Nathan Ridge via clangd-dev <<a href="mailto:clangd-dev@lists.llvm.org">clangd-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">>> Out of curiosity, though - if a client wanted to send all the CDBs upfront, to avoid the <br>
>> requirement that you have to open a file from each project, would that be a reasonable <br>
>> capability to add?<br>
> That seems doable. The way this currently works is:<br>
>  - A CDB is "discovered" the first time we try to get the command for a file under its directory<br>
>  - once a CDB is "discovered", the auto-index loads any index shards that exist for the CDB, <br>
> and starts indexing files that don't have an up-to-date shard<br>
> So we could add a custom command or a startup option to make clangd discover particular <br>
> CDBs (e.g. by looking for a compile command for dir/dummy.txt, and then throwing it away).<br>
<br>
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.<br>
<br>
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.<br>
<br>
Thanks,<br>
Nate<br>
<br>
[1] <a href="https://microsoft.github.io/language-server-protocol/specification#workspace_workspaceFolders" rel="noreferrer" target="_blank">https://microsoft.github.io/language-server-protocol/specification#workspace_workspaceFolders</a><br>
_______________________________________________<br>
clangd-dev mailing list<br>
<a href="mailto:clangd-dev@lists.llvm.org" target="_blank">clangd-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Regards,</div><div>Ilya Biryukov</div></div></div></div></div>