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



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to