From 4c20a880e6395f43e5fc9770c53c1034d08847a4 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 9 Jun 2022 13:41:41 +0200 Subject: Python: remove python specific language client settings Change-Id: Ic993d525f29c1925f7e64dfc6f5e053234fb4904 Reviewed-by: Christian Stenger --- src/plugins/python/pythoneditor.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/plugins/python/pythoneditor.cpp') 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 { -- cgit v1.2.1