forked from qt-creator/qt-creator
Clang: Reduce diagnostic visualization for non-project files further
We already avoided showing inline annotations for diagnostics in non-project files. But given many diagnostics the visualization is still quite noisy. E.g. consider opening not self-contained header files or files for which we do not have any project open, as it can happen if the debugger jumps to such a file. So leave only the text mark icon on the left and avoid all the rest: underlines and refactoring icons in the editor, marks in the scrollbar and task hub issues. Change-Id: I05245981b21b38be650489a006593922dcb6896d Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -68,7 +68,7 @@ static Core::Id categoryForSeverity(ClangBackEnd::DiagnosticSeverity severity)
|
||||
ClangTextMark::ClangTextMark(const FileName &fileName,
|
||||
const ClangBackEnd::DiagnosticContainer &diagnostic,
|
||||
const RemovedFromEditorHandler &removedHandler,
|
||||
bool showLineAnnotations)
|
||||
bool fullVisualization)
|
||||
: TextEditor::TextMark(fileName,
|
||||
int(diagnostic.location.line),
|
||||
categoryForSeverity(diagnostic.severity))
|
||||
@@ -76,15 +76,16 @@ ClangTextMark::ClangTextMark(const FileName &fileName,
|
||||
, m_removedFromEditorHandler(removedHandler)
|
||||
{
|
||||
const bool warning = isWarningOrNote(diagnostic.severity);
|
||||
setColor(warning ? ::Utils::Theme::ClangCodeModel_Warning_TextMarkColor
|
||||
: ::Utils::Theme::ClangCodeModel_Error_TextMarkColor);
|
||||
setDefaultToolTip(warning ? QApplication::translate("Clang Code Model Marks", "Code Model Warning")
|
||||
: QApplication::translate("Clang Code Model Marks", "Code Model Error"));
|
||||
setPriority(warning ? TextEditor::TextMark::NormalPriority
|
||||
: TextEditor::TextMark::HighPriority);
|
||||
updateIcon();
|
||||
if (showLineAnnotations)
|
||||
if (fullVisualization) {
|
||||
setLineAnnotation(Utils::diagnosticCategoryPrefixRemoved(diagnostic.text.toString()));
|
||||
setColor(warning ? ::Utils::Theme::ClangCodeModel_Warning_TextMarkColor
|
||||
: ::Utils::Theme::ClangCodeModel_Error_TextMarkColor);
|
||||
}
|
||||
}
|
||||
|
||||
void ClangTextMark::updateIcon(bool valid)
|
||||
|
||||
Reference in New Issue
Block a user