LanguageClient: Fix handling of defective language server

If the language server cannot be started, the client might be already in
an error state before the language server gets initialized.

Change-Id: Ib6c9df13b381e7854806714c07f4830796bb2cd3
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2022-12-06 09:47:18 +01:00
parent b7e70592d6
commit 8c8f3e30b5

View File

@@ -113,6 +113,8 @@ void LanguageClientManager::clientStarted(Client *client)
qCDebug(Log) << "client started: " << client->name() << client;
QTC_ASSERT(managerInstance, return);
QTC_ASSERT(client, return);
if (client->state() != Client::Uninitialized) // do not proceed if we already received an error
return;
if (g_shuttingDown) {
clientFinished(client);
return;