forked from qt-creator/qt-creator
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:
@@ -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";
|
||||||
|
|||||||
Reference in New Issue
Block a user