forked from qt-creator/qt-creator
Python: move language client functionality out of utils
There will be more lsp specific functionality so moving it into its own space is reasonable. Change-Id: Ic87d437182d68673b53f662c804707138fef5b6c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -27,50 +27,12 @@
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
#include <QHash>
|
||||
#include <QObject>
|
||||
|
||||
namespace Core { class IDocument; }
|
||||
namespace LanguageClient {
|
||||
class Client;
|
||||
class StdIOSettings;
|
||||
}
|
||||
namespace TextEditor { class TextDocument; }
|
||||
|
||||
namespace Python {
|
||||
namespace Internal {
|
||||
|
||||
enum class ReplType { Unmodified, Import, ImportToplevel };
|
||||
|
||||
void openPythonRepl(const Utils::FilePath &file, ReplType type);
|
||||
|
||||
struct PythonLanguageServerState;
|
||||
|
||||
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 handlePyLSState(const Utils::FilePath &python,
|
||||
const PythonLanguageServerState &state,
|
||||
TextEditor::TextDocument *document);
|
||||
void resetEditorInfoBar(TextEditor::TextDocument *document);
|
||||
void installPythonLanguageServer(const Utils::FilePath &python,
|
||||
QPointer<TextEditor::TextDocument> document);
|
||||
|
||||
QHash<Utils::FilePath, QList<TextEditor::TextDocument *>> m_infoBarEntries;
|
||||
};
|
||||
Utils::FilePath detectPython(const Utils::FilePath &documentPath);
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Python
|
||||
|
||||
Reference in New Issue
Block a user