diff options
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, |