summaryrefslogtreecommitdiff
path: root/src/plugins/python
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2019-10-17 10:14:48 +0200
committerDavid Schulz <david.schulz@qt.io>2019-10-18 05:23:40 +0000
commit8b040192701475ec8f0652b162f90b6ad1c5ea57 (patch)
tree540d7c713b49408385db4e24cdf1ce6c36976de3 /src/plugins/python
parent28c3f0c31ece00d29e59d854bae61f80e29e9c2a (diff)
downloadqt-creator-8b040192701475ec8f0652b162f90b6ad1c5ea57.tar.gz
Python: Fix opening document in wrong pyls
The document was always opened in the first of the configured python language servers. Change-Id: If33cb4a08884b93047016be1d8cf5c27ea7950d9 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/python')
-rw-r--r--src/plugins/python/pythonutils.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/python/pythonutils.cpp b/src/plugins/python/pythonutils.cpp
index acb78ef4c3..0af6d5fd5a 100644
--- a/src/plugins/python/pythonutils.cpp
+++ b/src/plugins/python/pythonutils.cpp
@@ -328,8 +328,15 @@ void updateEditorInfoBar(const FilePath &python, TextEditor::TextDocument *docum
{
const PythonLanguageServerState &lsState = checkPythonLanguageServer(python);
- if (lsState.state == PythonLanguageServerState::CanNotBeInstalled
- || lsState.state == PythonLanguageServerState::AlreadyConfigured) {
+ if (lsState.state == PythonLanguageServerState::CanNotBeInstalled)
+ return;
+ if (lsState.state == PythonLanguageServerState::AlreadyConfigured) {
+ if (const LanguageClient::StdIOSettings *setting = languageServerForPython(python)) {
+ if (LanguageClient::Client *client
+ = LanguageClient::LanguageClientManager::clientForSetting(setting).value(0)) {
+ LanguageClient::LanguageClientManager::reOpenDocumentWithClient(document, client);
+ }
+ }
return;
}