summaryrefslogtreecommitdiff
path: root/src/plugins/languageclient
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2022-10-11 13:10:10 +0200
committerDavid Schulz <david.schulz@qt.io>2022-10-14 09:08:11 +0000
commit01b07c0563c4f3f9465ef54bd7af2f766c1212f4 (patch)
treee341ad4c47c8d4d21933f94e55d11a7eaaaf18d9 /src/plugins/languageclient
parent1b6728538ec1325ff77aacfb24bb1c2cf1e50cb1 (diff)
downloadqt-creator-01b07c0563c4f3f9465ef54bd7af2f766c1212f4.tar.gz
LanguageClient: deactivate documents on client shutdown
Change-Id: I0a3aa89b1390f3cb7d5816bb85d9fd538fb3f90b Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/languageclient')
-rw-r--r--src/plugins/languageclient/client.cpp1
-rw-r--r--src/plugins/languageclient/languageclientmanager.cpp7
2 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp
index be68f93363..d61f3c720a 100644
--- a/src/plugins/languageclient/client.cpp
+++ b/src/plugins/languageclient/client.cpp
@@ -879,6 +879,7 @@ void Client::deactivateDocument(TextEditor::TextDocument *document)
TextEditor::TextEditorWidget *widget = textEditor->editorWidget();
widget->removeHoverHandler(&d->m_hoverHandler);
widget->setExtraSelections(TextEditor::TextEditorWidget::CodeSemanticsSelection, {});
+ updateEditorToolBar(editor);
}
}
}
diff --git a/src/plugins/languageclient/languageclientmanager.cpp b/src/plugins/languageclient/languageclientmanager.cpp
index d3c2220fc8..d4f5c44264 100644
--- a/src/plugins/languageclient/languageclientmanager.cpp
+++ b/src/plugins/languageclient/languageclientmanager.cpp
@@ -199,10 +199,10 @@ void LanguageClientManager::shutdownClient(Client *client)
if (!client)
return;
qCDebug(Log) << "request client shutdown: " << client->name() << client;
- // reset the documents for that client already when requesting the shutdown so they can get
- // reassigned to another server right after this request to another server
+ // reset and deactivate the documents for that client by assigning a null client already when
+ // requesting the shutdown so they can get reassigned to another server right after this request
for (TextEditor::TextDocument *document : managerInstance->m_clientForDocument.keys(client))
- managerInstance->m_clientForDocument.remove(document);
+ openDocumentWithClient(document, nullptr);
if (client->reachable())
client->shutdown();
else if (client->state() != Client::Shutdown && client->state() != Client::ShutdownRequested)
@@ -409,6 +409,7 @@ void LanguageClientManager::openDocumentWithClient(TextEditor::TextDocument *doc
Client *currentClient = clientForDocument(document);
if (client == currentClient)
return;
+ managerInstance->m_clientForDocument.remove(document);
if (currentClient)
currentClient->deactivateDocument(document);
managerInstance->m_clientForDocument[document] = client;