forked from qt-creator/qt-creator
Python: use correct python language server after installation
Change-Id: Ie5e26eedffc51e8916d849121fa60ea3d56e5a66 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -301,10 +301,13 @@ void PyLSConfigureAssistant::installPythonLanguageServer(const FilePath &python,
|
|||||||
auto install = new PipInstallTask(python);
|
auto install = new PipInstallTask(python);
|
||||||
|
|
||||||
connect(install, &PipInstallTask::finished, this, [=](const bool success) {
|
connect(install, &PipInstallTask::finished, this, [=](const bool success) {
|
||||||
|
const QList<TextEditor::TextDocument *> additionalDocuments = m_infoBarEntries.take(python);
|
||||||
if (success) {
|
if (success) {
|
||||||
if (document) {
|
if (PyLSClient *client = clientForPython(python)) {
|
||||||
if (PyLSClient *client = clientForPython(python))
|
if (document)
|
||||||
LanguageClientManager::openDocumentWithClient(document, client);
|
LanguageClientManager::openDocumentWithClient(document, client);
|
||||||
|
for (TextEditor::TextDocument *additionalDocument : additionalDocuments)
|
||||||
|
LanguageClientManager::openDocumentWithClient(additionalDocument, client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
install->deleteLater();
|
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)
|
void PyLSConfigureAssistant::resetEditorInfoBar(TextEditor::TextDocument *document)
|
||||||
{
|
{
|
||||||
for (QList<TextEditor::TextDocument *> &documents : m_infoBarEntries)
|
for (QList<TextEditor::TextDocument *> &documents : m_infoBarEntries)
|
||||||
|
|||||||
@@ -53,8 +53,6 @@ class PyLSConfigureAssistant : public QObject
|
|||||||
public:
|
public:
|
||||||
static PyLSConfigureAssistant *instance();
|
static PyLSConfigureAssistant *instance();
|
||||||
|
|
||||||
static void updateEditorInfoBars(const Utils::FilePath &python,
|
|
||||||
LanguageClient::Client *client);
|
|
||||||
static void openDocumentWithPython(const Utils::FilePath &python,
|
static void openDocumentWithPython(const Utils::FilePath &python,
|
||||||
TextEditor::TextDocument *document);
|
TextEditor::TextDocument *document);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user