From 319dea79241ec1b7f3fc4f6acfefbe441c91d913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20De=20Canni=C3=A8re?= Date: Fri, 15 Aug 2025 14:23:52 +0200 Subject: [PATCH] QQmlJSLogger: Also print out hints of fixSuggestions It otherwise went unused. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I255a53247d0cfce29d958425d1f8f2895eb093e7 Reviewed-by: Ulf Hermann --- src/qmlcompiler/qqmljslogger.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/qmlcompiler/qqmljslogger.cpp b/src/qmlcompiler/qqmljslogger.cpp index 8410032f48..6d42e4f545 100644 --- a/src/qmlcompiler/qqmljslogger.cpp +++ b/src/qmlcompiler/qqmljslogger.cpp @@ -477,13 +477,15 @@ void QQmlJSLogger::printFix(const QQmlJSFixSuggestion &fixItem) int tabCount = issueLocationWithContext.beforeText().count(u'\t'); // Do not draw location indicator for multiline replacement strings - if (replacementString.contains(u'\n')) - return; + if (!replacementString.contains(u'\n')) { + m_output.write(u" "_s.repeated( + issueLocationWithContext.beforeText().size() - tabCount) + + u"\t"_s.repeated(tabCount) + + u"^"_s.repeated(replacement.size()) + u'\n'); + } - m_output.write(u" "_s.repeated( - issueLocationWithContext.beforeText().size() - tabCount) - + u"\t"_s.repeated(tabCount) - + u"^"_s.repeated(replacement.size()) + u'\n'); + if (!fixItem.hint().isEmpty()) + m_output.write(" "_L1 + fixItem.hint()); } QQmlJSFixSuggestion::QQmlJSFixSuggestion(const QString &fixDescription,