refactor: Restructure project into sources/tests layout and dissolve PluginLLMCore

This commit is contained in:
Petr Mironychev
2026-07-14 02:50:43 +02:00
parent adef7972ed
commit 34d4f2c517
348 changed files with 809 additions and 852 deletions

View File

@@ -0,0 +1,60 @@
// Copyright (C) 2025-2026 Petr Mironychev
// SPDX-License-Identifier: GPL-3.0-or-later
// Additional attribution terms under GPLv3 §7(b) apply — see LICENSE
#pragma once
#include <QPointer>
#include <functional>
#include <texteditor/texteditor.h>
#include <utils/textutils.h>
namespace QodeAssist {
class RefactorWidget;
class RefactorWidgetHandler : public QObject
{
Q_OBJECT
public:
explicit RefactorWidgetHandler(QObject *parent = nullptr);
~RefactorWidgetHandler() override;
void showRefactorWidget(
TextEditor::TextEditorWidget *editor,
const QString &originalText,
const QString &refactoredText,
const Utils::Text::Range &range);
void showRefactorWidget(
TextEditor::TextEditorWidget *editor,
const QString &originalText,
const QString &refactoredText,
const Utils::Text::Range &range,
const QString &contextBefore,
const QString &contextAfter);
void hideRefactorWidget();
bool isWidgetVisible() const { return !m_refactorWidget.isNull(); }
void setApplyCallback(std::function<void(const QString &)> callback);
void setDeclineCallback(std::function<void()> callback);
void setTextToApply(const QString &text);
private:
QPointer<TextEditor::TextEditorWidget> m_editor;
QPointer<RefactorWidget> m_refactorWidget;
std::function<void(const QString &)> m_applyCallback;
std::function<void()> m_declineCallback;
void updateWidgetPosition();
QPoint calculateWidgetPosition();
int getEditorWidth() const;
};
} // namespace QodeAssist