forked from qt-creator/qt-creator
ClangTools: prevent creating duplicated diagnostic marks
If we already have marks from the analysis for the open file we do not need to create marks for the explicit analysis. Fixes: QTCREATORBUG-24955 Change-Id: Id550566c6e9a2dbd4e4eb3e9b9460a7778e39a50 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -821,7 +821,7 @@ void ClangTool::loadDiagnosticsFromFiles()
|
||||
|
||||
// Show imported
|
||||
reset();
|
||||
onNewDiagnosticsAvailable(diagnostics);
|
||||
onNewDiagnosticsAvailable(diagnostics, /*generateMarks =*/ true);
|
||||
setState(State::ImportFinished);
|
||||
}
|
||||
|
||||
@@ -1125,10 +1125,10 @@ QSet<Diagnostic> ClangTool::diagnostics() const
|
||||
});
|
||||
}
|
||||
|
||||
void ClangTool::onNewDiagnosticsAvailable(const Diagnostics &diagnostics)
|
||||
void ClangTool::onNewDiagnosticsAvailable(const Diagnostics &diagnostics, bool generateMarks)
|
||||
{
|
||||
QTC_ASSERT(m_diagnosticModel, return);
|
||||
m_diagnosticModel->addDiagnostics(diagnostics);
|
||||
m_diagnosticModel->addDiagnostics(diagnostics, generateMarks);
|
||||
}
|
||||
|
||||
void ClangTool::updateForCurrentState()
|
||||
|
||||
Reference in New Issue
Block a user