diff options
| author | Olivier De Cannière <olivier.decanniere@qt.io> | 2025-08-15 14:23:52 +0200 |
|---|---|---|
| committer | Olivier De Cannière <olivier.decanniere@qt.io> | 2025-08-20 16:32:36 +0200 |
| commit | 319dea79241ec1b7f3fc4f6acfefbe441c91d913 (patch) | |
| tree | 24772556d4a2b34203ccb1f9b6033b657c5b97da /src/qmlcompiler/qqmljslogger.cpp | |
| parent | 5d1840fcdebc5fcfdd93c2dd882781b314d1fee8 (diff) | |
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 <ulf.hermann@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljslogger.cpp')
| -rw-r--r-- | src/qmlcompiler/qqmljslogger.cpp | 14 |
1 files 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, |
