diff options
author | Ilya Biryukov <ibiryukov@google.com> | 2017-10-25 08:45:41 +0000 |
---|---|---|
committer | Ilya Biryukov <ibiryukov@google.com> | 2017-10-25 08:45:41 +0000 |
commit | beeb16c5ce541eb31cbc55c98d2f78e605890e01 (patch) | |
tree | 624848254a3103f4c26a100bf38ca7e0f08b28bd /clangd/ProtocolHandlers.cpp | |
parent | 9d0509f12c766988d880e824b2be5ca7c30eb3d9 (diff) |
[clangd] Handle exit notification (proper shutdown)
Summary:
This changes the onShutdown handler to do essentially nothing (for now), and
instead exits the runloop when we receive the exit notification from the client.
Some clients may wait on the reply from the shutdown request before sending an
exit notification. If we exit the runloop already in the shutdown request, a
client might block forever.
This also gives us the opportunity to do any global cleanups and/or
serializations of PCH preambles to disk, but I've left that out for now.
See the LSP protocol documentation for details.
Reviewers: malaperle, krasimir, bkramer, sammccall, ilya-biryukov
Reviewed By: malaperle, sammccall, ilya-biryukov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D38939
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@316564 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clangd/ProtocolHandlers.cpp')
-rw-r--r-- | clangd/ProtocolHandlers.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clangd/ProtocolHandlers.cpp b/clangd/ProtocolHandlers.cpp index 7891e5bf..6dcc3f5e 100644 --- a/clangd/ProtocolHandlers.cpp +++ b/clangd/ProtocolHandlers.cpp @@ -52,6 +52,7 @@ void clangd::registerCallbackHandlers(JSONRPCDispatcher &Dispatcher, Register("initialize", &ProtocolCallbacks::onInitialize); Register("shutdown", &ProtocolCallbacks::onShutdown); + Register("exit", &ProtocolCallbacks::onExit); Register("textDocument/didOpen", &ProtocolCallbacks::onDocumentDidOpen); Register("textDocument/didClose", &ProtocolCallbacks::onDocumentDidClose); Register("textDocument/didChange", &ProtocolCallbacks::onDocumentDidChange); |