From 06bd7db7eaad67f6e74aa3b788ce480420ecf4cc Mon Sep 17 00:00:00 2001 From: Petr Mironychev <9195189+Palm1r@users.noreply.github.com> Date: Mon, 17 Nov 2025 14:39:59 +0100 Subject: [PATCH] chore: Remove extra comments --- RefactorSuggestion.hpp | 22 ---------------------- RefactorSuggestionHoverHandler.cpp | 17 ----------------- 2 files changed, 39 deletions(-) diff --git a/RefactorSuggestion.hpp b/RefactorSuggestion.hpp index c2aeb5b..4b2be9a 100644 --- a/RefactorSuggestion.hpp +++ b/RefactorSuggestion.hpp @@ -24,37 +24,15 @@ namespace QodeAssist { -/** - * @brief Persistent refactoring suggestion that displays code changes inline - * - * Unlike LLMSuggestion which supports partial acceptance (word/line), - * RefactorSuggestion is designed to show complete refactoring results - * that must be either fully accepted or rejected by the user. - */ class RefactorSuggestion : public TextEditor::TextSuggestion { public: - /** - * @brief Constructs a refactoring suggestion - * @param suggestion Suggestion data (range, position, text) - * @param sourceDocument The document where suggestion will be displayed - */ RefactorSuggestion(const Data &suggestion, QTextDocument *sourceDocument); - /** - * @brief Applies the full refactoring suggestion with smart overlapping - * @return true if suggestion was applied successfully - */ bool apply() override; - /** - * @brief Disabled: Word-by-word acceptance not supported for refactoring - */ bool applyWord(TextEditor::TextEditorWidget *widget) override; - /** - * @brief Disabled: Line-by-line acceptance not supported for refactoring - */ bool applyLine(TextEditor::TextEditorWidget *widget) override; private: diff --git a/RefactorSuggestionHoverHandler.cpp b/RefactorSuggestionHoverHandler.cpp index 86fe7d1..0eb24de 100644 --- a/RefactorSuggestionHoverHandler.cpp +++ b/RefactorSuggestionHoverHandler.cpp @@ -58,15 +58,10 @@ void RefactorSuggestionHoverHandler::identifyMatch( int pos, ReportPriority report) { - LOG_MESSAGE(QString("RefactorSuggestionHoverHandler::identifyMatch pos=%1, hasSuggestion=%2, suggestionVisible=%3") - .arg(pos) - .arg(m_hasSuggestion) - .arg(editorWidget->suggestionVisible())); QScopeGuard cleanup([&] { report(Priority_None); }); if (!editorWidget->suggestionVisible()) { - LOG_MESSAGE("RefactorSuggestionHoverHandler: No suggestion visible"); return; } @@ -74,7 +69,6 @@ void RefactorSuggestionHoverHandler::identifyMatch( cursor.setPosition(pos); m_block = cursor.block(); - // Check if this block has a suggestion #if QODEASSIST_QT_CREATOR_VERSION_MAJOR >= 17 auto *suggestion = dynamic_cast( TextEditor::TextBlockUserData::suggestion(m_block)); @@ -89,11 +83,9 @@ void RefactorSuggestionHoverHandler::identifyMatch( #endif if (!suggestion) { - LOG_MESSAGE("RefactorSuggestionHoverHandler: No RefactorSuggestion in block"); return; } - LOG_MESSAGE("RefactorSuggestionHoverHandler: Found RefactorSuggestion, reporting Priority_Suggestion"); cleanup.dismiss(); report(Priority_Suggestion); } @@ -118,19 +110,14 @@ void RefactorSuggestionHoverHandler::operateTooltip( #endif if (!suggestion) { - LOG_MESSAGE("RefactorSuggestionHoverHandler::operateTooltip: No suggestion in block"); return; } - LOG_MESSAGE("RefactorSuggestionHoverHandler::operateTooltip: Creating tooltip widget"); - - // Create compact widget with buttons auto *widget = new QWidget(); auto *layout = new QHBoxLayout(widget); layout->setContentsMargins(4, 3, 4, 3); layout->setSpacing(6); - // Get theme colors const QColor normalBg = Utils::creatorColor(Utils::Theme::BackgroundColorNormal); const QColor hoverBg = Utils::creatorColor(Utils::Theme::BackgroundColorHover); const QColor selectedBg = Utils::creatorColor(Utils::Theme::BackgroundColorSelected); @@ -211,15 +198,11 @@ void RefactorSuggestionHoverHandler::operateTooltip( layout->addWidget(applyButton); layout->addWidget(dismissButton); - // Position tooltip above cursor, like standard Qt Creator suggestions const QRect cursorRect = editorWidget->cursorRect(editorWidget->textCursor()); QPoint pos = editorWidget->viewport()->mapToGlobal(cursorRect.topLeft()) - Utils::ToolTip::offsetFromPosition(); pos.ry() -= widget->sizeHint().height(); - LOG_MESSAGE(QString("RefactorSuggestionHoverHandler::operateTooltip: Showing tooltip at (%1, %2)") - .arg(pos.x()).arg(pos.y())); - Utils::ToolTip::show(pos, widget, editorWidget); }