[PATCH] D49833: [clangd] Receive compilationDatabasePath in 'initialize' request

Marc-Andre Laperle via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 26 12:54:17 PDT 2018


malaperle added a comment.

In https://reviews.llvm.org/D49833#1176337, @ilya-biryukov wrote:

> Not strictly opposed to this change, but is there any reason why the clients can't guarantee they'll send didChangeConfiguration right after clangd is initialized?


LSP:

> Until the server has responded to the initialize request with an InitializeResult, the client must not send any additional requests or notifications to the server.

So the client is free to send "didOpen" or any request after the "initialize", which means we could end up parsing files with wrong commands before we get the first "didChangeConfiguration". In fact, in our indexing prototype we start indexing as soon as the "initialize" is processed and we do not know whether or not there will be a didChangeConfiguration soon after.
Setting the CDB path as part of the initialize seems more natural and less error-prone.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D49833





More information about the cfe-commits mailing list