LSP: Robustify open documents

Use Client::openDocument if you just want to open a document and
activate it if it is not already used in another client.

Use LanguageClientManager::openDocumentWithClient if you want to make
sure a document is opened _and_ activated for a specific client.

Change-Id: I6b790f15e17335ce2dc8981a04d2cd571b22b66b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2020-05-12 09:20:01 +02:00
parent f3407bb0ca
commit 8f5109b6ee
5 changed files with 34 additions and 36 deletions

View File

@@ -231,7 +231,7 @@ void updateEditorToolBar(Core::IEditor *editor)
auto reopen = [action, client = QPointer<Client>(client), document]() {
if (!client)
return;
LanguageClientManager::reOpenDocumentWithClient(document, client);
LanguageClientManager::openDocumentWithClient(document, client);
action->setChecked(true);
};
action->setCheckable(true);