forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -328,8 +328,15 @@ void updateEditorInfoBar(const FilePath &python, TextEditor::TextDocument *docum
|
|||||||
{
|
{
|
||||||
const PythonLanguageServerState &lsState = checkPythonLanguageServer(python);
|
const PythonLanguageServerState &lsState = checkPythonLanguageServer(python);
|
||||||
|
|
||||||
if (lsState.state == PythonLanguageServerState::CanNotBeInstalled
|
if (lsState.state == PythonLanguageServerState::CanNotBeInstalled)
|
||||||
|| lsState.state == PythonLanguageServerState::AlreadyConfigured) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user