Python: close all info bars after language server setup

Change-Id: I607f7cb5a31f3db0c7d7d77011860a1ea87eb8d2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2019-10-18 10:31:14 +02:00
parent 088d5c0f77
commit 10c94994db
6 changed files with 134 additions and 82 deletions

View File

@@ -23,21 +23,45 @@
**
****************************************************************************/
#include <utils/fileutils.h>
#pragma once
#include <utils/fileutils.h>
#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