From d73fbbcb97bb47f8804b67ead0052e145badc0ad Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 22 Feb 2022 13:20:55 +0100 Subject: [PATCH] LanguageClient: send exit notification after failed shutdown Despite receiving an error in the shutdown response continue to exit the server. Otherwise we end up with an unusable client. Change-Id: Iacff38699cb4e5bcc5610eba1654047bf7f8ce80 Reviewed-by: Christian Kandeler --- src/plugins/languageclient/client.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 2b7594539cc..eb2633fef1b 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -1560,12 +1560,8 @@ void Client::shutDownCallback(const ShutdownRequest::Response &shutdownResponse) m_shutdownTimer.stop(); QTC_ASSERT(m_state == ShutdownRequested, return); QTC_ASSERT(m_clientInterface, return); - optional errorValue = shutdownResponse.error(); - if (errorValue.has_value()) { - ShutdownRequest::Response::Error error = errorValue.value(); - qDebug() << error; - return; - } + if (optional error = shutdownResponse.error()) + log(*error); // directly send message otherwise the state check of sendContent would fail sendMessage(ExitNotification().toBaseMessage()); qCDebug(LOGLSPCLIENT) << "language server " << m_displayName << " shutdown";