[clangd] Avoid possible crash: apply configuration after binding methods
authorSam McCall <sam.mccall@gmail.com>
Sat, 20 Nov 2021 00:10:30 +0000 (01:10 +0100)
committerSam McCall <sam.mccall@gmail.com>
Sat, 20 Nov 2021 00:13:38 +0000 (01:13 +0100)
commitf764a1a5bd7c281d3d7cc3c6d7f1430711176762
tree15f4f15f4d0d75289bd3b2553ab245607b21d1db
parentde11de308b6480fc35d901c7104f46918674418c
[clangd] Avoid possible crash: apply configuration after binding methods

The configuration may kick off indexing, which may involve sending LSP
messages.
The crash is fiddly to reproduce in a hermetic test (we need background
indexing on without disk storage, and to handle server->client messages
in LSPClient...)

Fixes https://github.com/clangd/clangd/issues/926
clang-tools-extra/clangd/ClangdLSPServer.cpp