forked from qt-creator/qt-creator
Clang: Polish tool tip text for diagnostic
* Set the category apart. * Show only the disable option and only in debug mode. Change-Id: If5f65f9bd04c8e37e376a9862035005f4456394a Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
@@ -94,15 +94,16 @@ bool isHelpfulChildDiagnostic(const ClangBackEnd::DiagnosticContainer &parentDia
|
|||||||
QString diagnosticText(const ClangBackEnd::DiagnosticContainer &diagnostic)
|
QString diagnosticText(const ClangBackEnd::DiagnosticContainer &diagnostic)
|
||||||
{
|
{
|
||||||
QString text = diagnostic.category().toString()
|
QString text = diagnostic.category().toString()
|
||||||
+ QStringLiteral(" ")
|
+ QStringLiteral("\n\n")
|
||||||
+ diagnostic.text().toString();
|
+ diagnostic.text().toString();
|
||||||
if (!diagnostic.enableOption().isEmpty()) {
|
|
||||||
text += QStringLiteral(" (clang option: ")
|
#ifdef QT_DEBUG
|
||||||
+ diagnostic.enableOption().toString()
|
if (!diagnostic.disableOption().isEmpty()) {
|
||||||
+ QStringLiteral(" disable with: ")
|
text += QStringLiteral(" (disable with ")
|
||||||
+ diagnostic.disableOption().toString()
|
+ diagnostic.disableOption().toString()
|
||||||
+ QStringLiteral(")");
|
+ QStringLiteral(")");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
for (auto &&childDiagnostic : diagnostic.children()) {
|
for (auto &&childDiagnostic : diagnostic.children()) {
|
||||||
if (isHelpfulChildDiagnostic(diagnostic, childDiagnostic))
|
if (isHelpfulChildDiagnostic(diagnostic, childDiagnostic))
|
||||||
|
Reference in New Issue
Block a user