reformat in uvosstyle
This commit is contained in:
73
kateai.h
73
kateai.h
@ -15,62 +15,61 @@
|
||||
|
||||
class KateAiPlugin : public KTextEditor::Plugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
private:
|
||||
QWebSocket m_webSocket;
|
||||
QUrl m_serverUrl;
|
||||
QWebSocket m_webSocket;
|
||||
QUrl m_serverUrl;
|
||||
|
||||
private:
|
||||
void onConnected();
|
||||
void onConnected();
|
||||
|
||||
int configPages() const override
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
int configPages() const override
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
KTextEditor::ConfigPage *configPage(int number = 0, QWidget *parent = nullptr) override;
|
||||
KTextEditor::ConfigPage *configPage(int number = 0, QWidget *parent = nullptr) override;
|
||||
|
||||
public:
|
||||
explicit KateAiPlugin(QObject *parent = nullptr, const QList<QVariant> & = QList<QVariant>());
|
||||
~KateAiPlugin() override;
|
||||
explicit KateAiPlugin(QObject *parent = nullptr, const QList<QVariant> & = QList<QVariant>());
|
||||
~KateAiPlugin() override;
|
||||
|
||||
QObject *createView(KTextEditor::MainWindow *mainWindow) override;
|
||||
QObject *createView(KTextEditor::MainWindow *mainWindow) override;
|
||||
|
||||
void readConfig();
|
||||
void reconnect();
|
||||
Q_SIGNAL void instructChanged();
|
||||
void readConfig();
|
||||
void reconnect();
|
||||
Q_SIGNAL void instructChanged();
|
||||
};
|
||||
|
||||
class KateAiPluginView : public QObject, public KXMLGUIClient
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
private:
|
||||
struct Request
|
||||
{
|
||||
KTextEditor::Cursor cursor;
|
||||
QPointer<KTextEditor::Document> document;
|
||||
};
|
||||
|
||||
KTextEditor::MainWindow *m_mainWindow;
|
||||
QPointer<QWebSocket> m_webSocket;
|
||||
QHash<int, Request> m_requests;
|
||||
bool m_useInstruct = false;
|
||||
struct Request
|
||||
{
|
||||
KTextEditor::Cursor cursor;
|
||||
QPointer<KTextEditor::Document> document;
|
||||
};
|
||||
|
||||
KTextEditor::MainWindow *m_mainWindow;
|
||||
QPointer<QWebSocket> m_webSocket;
|
||||
QHash<int, Request> m_requests;
|
||||
bool m_useInstruct = false;
|
||||
|
||||
private:
|
||||
void generate();
|
||||
void socketMessage(const QString& message);
|
||||
static QStringList getIncludePaths(const QString& text);
|
||||
QString assembleContext(QPointer<KTextEditor::Document> document, const KTextEditor::Cursor& cursor);
|
||||
|
||||
QPointer<KTextEditor::Document> activeDocument() const;
|
||||
KTextEditor::Cursor getCurrentCursor() const;
|
||||
void generate();
|
||||
void socketMessage(const QString& message);
|
||||
static QStringList getIncludePaths(const QString& text);
|
||||
QString assembleContext(QPointer<KTextEditor::Document> document, const KTextEditor::Cursor& cursor);
|
||||
|
||||
QPointer<KTextEditor::Document> activeDocument() const;
|
||||
KTextEditor::Cursor getCurrentCursor() const;
|
||||
|
||||
public:
|
||||
KateAiPluginView(KateAiPlugin *plugin, KTextEditor::MainWindow *mainwindow, QPointer<QWebSocket> webSocket, bool instruct = false);
|
||||
~KateAiPluginView() override;
|
||||
void setInstruct(bool instruct);
|
||||
KateAiPluginView(KateAiPlugin *plugin, KTextEditor::MainWindow *mainwindow, QPointer<QWebSocket> webSocket,
|
||||
bool instruct = false);
|
||||
~KateAiPluginView() override;
|
||||
void setInstruct(bool instruct);
|
||||
|
||||
Q_SIGNAL void reconnect();
|
||||
Q_SIGNAL void reconnect();
|
||||
};
|
||||
|
Reference in New Issue
Block a user