summaryrefslogtreecommitdiff
path: root/src/plugins/python/pythonutils.h
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2019-10-18 10:31:14 +0200
committerDavid Schulz <david.schulz@qt.io>2019-10-25 12:50:24 +0000
commit10c94994db84c920ebf1ff43b6b5fe5224ee8afa (patch)
treea98f6f5fac876b18a72072635d47bfe166ad4e9b /src/plugins/python/pythonutils.h
parent088d5c0f779edc12605a04486d223749c3158152 (diff)
downloadqt-creator-10c94994db84c920ebf1ff43b6b5fe5224ee8afa.tar.gz
Python: close all info bars after language server setup
Change-Id: I607f7cb5a31f3db0c7d7d77011860a1ea87eb8d2 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/python/pythonutils.h')
-rw-r--r--src/plugins/python/pythonutils.h38
1 files changed, 31 insertions, 7 deletions
diff --git a/src/plugins/python/pythonutils.h b/src/plugins/python/pythonutils.h
index f376a4d749..20cb674ddb 100644
--- a/src/plugins/python/pythonutils.h
+++ b/src/plugins/python/pythonutils.h
@@ -23,21 +23,45 @@
**
****************************************************************************/
+#pragma once
+
#include <utils/fileutils.h>
-#pragma once
+#include <QHash>
+#include <QObject>
+namespace Core { class IDocument; }
+namespace LanguageClient {
+class Client;
+class StdIOSettings;
+}
namespace TextEditor { class TextDocument; }
-namespace LanguageClient { class StdIOSettings; }
namespace Python {
namespace Internal {
-QList<const LanguageClient::StdIOSettings *> configuredPythonLanguageServers();
-const LanguageClient::StdIOSettings *languageServerForPython(const Utils::FilePath &python);
-Utils::FilePath detectPython(const Utils::FilePath &NdocumentPath);
-void updateEditorInfoBar(const Utils::FilePath &python, TextEditor::TextDocument *document);
-void resetEditorInfoBar(TextEditor::TextDocument *document);
+class PyLSConfigureAssistant : public QObject
+{
+ Q_OBJECT
+public:
+ static PyLSConfigureAssistant *instance();
+
+ static const LanguageClient::StdIOSettings *languageServerForPython(
+ const Utils::FilePath &python);
+ static void documentOpened(Core::IDocument *document);
+ static void updateEditorInfoBars(const Utils::FilePath &python, LanguageClient::Client *client);
+
+ void openDocumentWithPython(const Utils::FilePath &python, TextEditor::TextDocument *document);
+
+private:
+ explicit PyLSConfigureAssistant(QObject *parent);
+
+ void resetEditorInfoBar(TextEditor::TextDocument *document);
+ void installPythonLanguageServer(const Utils::FilePath &python,
+ QPointer<TextEditor::TextDocument> document);
+
+ QHash<Utils::FilePath, QList<TextEditor::TextDocument *>> m_infoBarEntries;
+};
} // namespace Internal
} // namespace Python