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 <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2022-02-22 13:20:55 +01:00
parent 7e3585a64e
commit d73fbbcb97

View File

@@ -1560,12 +1560,8 @@ void Client::shutDownCallback(const ShutdownRequest::Response &shutdownResponse)
m_shutdownTimer.stop(); m_shutdownTimer.stop();
QTC_ASSERT(m_state == ShutdownRequested, return); QTC_ASSERT(m_state == ShutdownRequested, return);
QTC_ASSERT(m_clientInterface, return); QTC_ASSERT(m_clientInterface, return);
optional<ShutdownRequest::Response::Error> errorValue = shutdownResponse.error(); if (optional<ShutdownRequest::Response::Error> error = shutdownResponse.error())
if (errorValue.has_value()) { log(*error);
ShutdownRequest::Response::Error error = errorValue.value();
qDebug() << error;
return;
}
// directly send message otherwise the state check of sendContent would fail // directly send message otherwise the state check of sendContent would fail
sendMessage(ExitNotification().toBaseMessage()); sendMessage(ExitNotification().toBaseMessage());
qCDebug(LOGLSPCLIENT) << "language server " << m_displayName << " shutdown"; qCDebug(LOGLSPCLIENT) << "language server " << m_displayName << " shutdown";