diff --git a/src/plugins/python/pythoneditor.cpp b/src/plugins/python/pythoneditor.cpp index 32fd9e92664..2a6c0d094cb 100644 --- a/src/plugins/python/pythoneditor.cpp +++ b/src/plugins/python/pythoneditor.cpp @@ -120,13 +120,13 @@ public: if (python.exists()) PyLSConfigureAssistant::openDocumentWithPython(python, this); }); + connect(this, &PythonDocument::openFinishedSuccessfully, + this, &PythonDocument::checkForPyls); } - void setFilePath(const Utils::FilePath &filePath) override + void checkForPyls() { - TextEditor::TextDocument::setFilePath(filePath); - - const Utils::FilePath &python = detectPython(filePath); + const Utils::FilePath &python = detectPython(filePath()); if (!python.exists()) return;