From beeb16c5ce541eb31cbc55c98d2f78e605890e01 Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Wed, 25 Oct 2017 08:45:41 +0000 Subject: [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 --- clangd/ProtocolHandlers.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clangd/ProtocolHandlers.cpp') 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); -- cgit v1.2.3