From 8639cfcc504a157c67bca49b3e36b8e49bfbb6d8 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Wed, 23 May 2018 10:43:18 +0200 Subject: [PATCH] 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 --- src/plugins/clangcodemodel/clangdiagnostictooltipwidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/clangcodemodel/clangdiagnostictooltipwidget.cpp b/src/plugins/clangcodemodel/clangdiagnostictooltipwidget.cpp index d590870c59b..202b97e2be9 100644 --- a/src/plugins/clangcodemodel/clangdiagnostictooltipwidget.cpp +++ b/src/plugins/clangcodemodel/clangdiagnostictooltipwidget.cpp @@ -212,8 +212,8 @@ private: static ClangBackEnd::DiagnosticContainer supplementedDiagnostic( const ClangBackEnd::DiagnosticContainer &diagnostic) { - if (!diagnostic.category.isEmpty() && !diagnostic.enableOption.isEmpty()) - return diagnostic; // OK, diagnostics from clang have this set. + if (!diagnostic.category.isEmpty()) + return diagnostic; // OK, diagnostics from clang itself have this set. ClangBackEnd::DiagnosticContainer supplementedDiagnostic = diagnostic;