Python: use correct python language server after installation

Change-Id: Ie5e26eedffc51e8916d849121fa60ea3d56e5a66
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2023-10-24 11:19:51 +02:00
parent 250b82ba32
commit 0117b1669b
2 changed files with 5 additions and 13 deletions

View File

@@ -301,10 +301,13 @@ void PyLSConfigureAssistant::installPythonLanguageServer(const FilePath &python,
auto install = new PipInstallTask(python);
connect(install, &PipInstallTask::finished, this, [=](const bool success) {
const QList<TextEditor::TextDocument *> additionalDocuments = m_infoBarEntries.take(python);
if (success) {
if (document) {
if (PyLSClient *client = clientForPython(python))
if (PyLSClient *client = clientForPython(python)) {
if (document)
LanguageClientManager::openDocumentWithClient(document, client);
for (TextEditor::TextDocument *additionalDocument : additionalDocuments)
LanguageClientManager::openDocumentWithClient(additionalDocument, client);
}
}
install->deleteLater();
@@ -375,15 +378,6 @@ void PyLSConfigureAssistant::handlePyLSState(const FilePath &python,
}
}
void PyLSConfigureAssistant::updateEditorInfoBars(const FilePath &python, Client *client)
{
for (TextEditor::TextDocument *document : instance()->m_infoBarEntries.take(python)) {
instance()->resetEditorInfoBar(document);
if (client)
LanguageClientManager::openDocumentWithClient(document, client);
}
}
void PyLSConfigureAssistant::resetEditorInfoBar(TextEditor::TextDocument *document)
{
for (QList<TextEditor::TextDocument *> &documents : m_infoBarEntries)

View File

@@ -53,8 +53,6 @@ class PyLSConfigureAssistant : public QObject
public:
static PyLSConfigureAssistant *instance();
static void updateEditorInfoBars(const Utils::FilePath &python,
LanguageClient::Client *client);
static void openDocumentWithPython(const Utils::FilePath &python,
TextEditor::TextDocument *document);