summaryrefslogtreecommitdiff
path: root/src/plugins/python/pythoneditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/python/pythoneditor.cpp')
-rw-r--r--src/plugins/python/pythoneditor.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/plugins/python/pythoneditor.cpp b/src/plugins/python/pythoneditor.cpp
index 562f69f5d7..32fd9e9266 100644
--- a/src/plugins/python/pythoneditor.cpp
+++ b/src/plugins/python/pythoneditor.cpp
@@ -108,7 +108,19 @@ static QWidget *createEditorWidget()
class PythonDocument : public TextEditor::TextDocument
{
public:
- PythonDocument() : TextEditor::TextDocument(Constants::C_PYTHONEDITOR_ID) {}
+ PythonDocument() : TextEditor::TextDocument(Constants::C_PYTHONEDITOR_ID)
+ {
+ connect(PythonSettings::instance(),
+ &PythonSettings::pylsEnabledChanged,
+ this,
+ [this](const bool enabled) {
+ if (!enabled)
+ return;
+ const Utils::FilePath &python = detectPython(filePath());
+ if (python.exists())
+ PyLSConfigureAssistant::openDocumentWithPython(python, this);
+ });
+ }
void setFilePath(const Utils::FilePath &filePath) override
{