chore: Remove extra comments

This commit is contained in:
Petr Mironychev
2025-11-17 14:39:59 +01:00
parent 43f9e4e75b
commit 06bd7db7ea
2 changed files with 0 additions and 39 deletions

View File

@ -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<RefactorSuggestion *>(
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);
}