2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2021 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2021-12-13 14:19:30 +01:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <utils/fileutils.h>
|
2022-05-25 15:24:09 +02:00
|
|
|
#include <utils/temporarydirectory.h>
|
2021-12-13 14:19:30 +01:00
|
|
|
|
2021-12-13 15:30:21 +01:00
|
|
|
#include <languageclient/client.h>
|
|
|
|
|
#include <languageclient/languageclientsettings.h>
|
|
|
|
|
|
2021-12-13 14:19:30 +01:00
|
|
|
namespace Core { class IDocument; }
|
2022-05-25 15:24:09 +02:00
|
|
|
namespace ProjectExplorer { class ExtraCompiler; }
|
2021-12-13 14:19:30 +01:00
|
|
|
namespace TextEditor { class TextDocument; }
|
|
|
|
|
|
2022-07-15 11:49:34 +02:00
|
|
|
namespace Python::Internal {
|
2021-12-13 14:19:30 +01:00
|
|
|
|
2022-05-25 15:24:09 +02:00
|
|
|
class PySideUicExtraCompiler;
|
|
|
|
|
class PythonLanguageServerState;
|
2022-06-15 12:44:44 +02:00
|
|
|
class PyLSInterface;
|
2022-05-25 15:24:09 +02:00
|
|
|
|
|
|
|
|
class PyLSClient : public LanguageClient::Client
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2022-06-15 12:44:44 +02:00
|
|
|
explicit PyLSClient(PyLSInterface *interface);
|
2022-06-09 13:41:41 +02:00
|
|
|
~PyLSClient();
|
2022-05-25 15:24:09 +02:00
|
|
|
|
|
|
|
|
void openDocument(TextEditor::TextDocument *document) override;
|
|
|
|
|
void projectClosed(ProjectExplorer::Project *project) override;
|
|
|
|
|
|
|
|
|
|
void updateExtraCompilers(ProjectExplorer::Project *project,
|
|
|
|
|
const QList<PySideUicExtraCompiler *> &extraCompilers);
|
|
|
|
|
|
|
|
|
|
static PyLSClient *clientForPython(const Utils::FilePath &python);
|
2022-06-09 13:41:41 +02:00
|
|
|
void updateConfiguration();
|
2022-05-25 15:24:09 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void updateExtraCompilerContents(ProjectExplorer::ExtraCompiler *compiler,
|
|
|
|
|
const Utils::FilePath &file);
|
|
|
|
|
void closeExtraDoc(const Utils::FilePath &file);
|
|
|
|
|
void closeExtraCompiler(ProjectExplorer::ExtraCompiler *compiler);
|
|
|
|
|
|
|
|
|
|
Utils::FilePaths m_extraWorkspaceDirs;
|
|
|
|
|
Utils::FilePath m_extraCompilerOutputDir;
|
|
|
|
|
|
|
|
|
|
QHash<ProjectExplorer::Project *, QList<ProjectExplorer::ExtraCompiler *>> m_extraCompilers;
|
|
|
|
|
};
|
2021-12-13 14:19:30 +01:00
|
|
|
|
2024-01-15 17:26:18 +01:00
|
|
|
void openDocumentWithPython(const Utils::FilePath &python, TextEditor::TextDocument *document);
|
2021-12-13 14:19:30 +01:00
|
|
|
|
2022-07-15 11:49:34 +02:00
|
|
|
} // Python::Internal
|