[clangd] Add server capability advertising hot-reloading of CDBs.
authorSam McCall <sam.mccall@gmail.com>
Thu, 7 Jan 2021 10:40:33 +0000 (11:40 +0100)
committerSam McCall <sam.mccall@gmail.com>
Thu, 7 Jan 2021 12:39:21 +0000 (13:39 +0100)
commit213329d7c64f9710f23a78596255509b147b37c6
treec81fcb334fefbe42611b229df6a688f9b701462b
parent10164a2e50b4d7064bd02e7403aae6dd319cdd64
[clangd] Add server capability advertising hot-reloading of CDBs.

Currently some clients watch for CDB changes and restart clangd, now that we
can reload compile_commands.json ourselves this is counterproductive.
The capability allows this behavior to be phased out.

This is going to be a mild regression, as we do not actually watch for files on
disk and so new diagnostics need to wait until a rebuild is requested e.g. due
to file change (and the internal caches have expired).
However this is still a better tradeoff (and if it's important, we can request
the client to watch files for us in the future).

Differential Revision: https://reviews.llvm.org/D94222
clang-tools-extra/clangd/ClangdLSPServer.cpp
clang-tools-extra/clangd/test/initialize-params.test