forked from qt-creator/qt-creator
Clang: Fix empty category/option header in diagnostic tooltip
We assumed that diagnostics from clang itself (not tidy, clazy) have
always an enable option set, but this is not true as can be easily
observed with invalid code:
bla // error: unknown type name 'bla'
Due to the assumption we were running into the
conclude-category-and-option-for-tidy-and-clazy code path, which failed
and resulted in an empty category and thus an empty line in the tooltip.
Change-Id: Ic21629a637a7b0e5736ac514dc826bdc4c0cf91d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -212,8 +212,8 @@ private:
|
|||||||
static ClangBackEnd::DiagnosticContainer supplementedDiagnostic(
|
static ClangBackEnd::DiagnosticContainer supplementedDiagnostic(
|
||||||
const ClangBackEnd::DiagnosticContainer &diagnostic)
|
const ClangBackEnd::DiagnosticContainer &diagnostic)
|
||||||
{
|
{
|
||||||
if (!diagnostic.category.isEmpty() && !diagnostic.enableOption.isEmpty())
|
if (!diagnostic.category.isEmpty())
|
||||||
return diagnostic; // OK, diagnostics from clang have this set.
|
return diagnostic; // OK, diagnostics from clang itself have this set.
|
||||||
|
|
||||||
ClangBackEnd::DiagnosticContainer supplementedDiagnostic = diagnostic;
|
ClangBackEnd::DiagnosticContainer supplementedDiagnostic = diagnostic;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user