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:
@@ -364,8 +364,12 @@ void ClangToolRunWorker::onRunnerFinishedWithSuccess(const QString &filePath)
|
||||
} else {
|
||||
if (!m_filesNotAnalyzed.contains(filePath))
|
||||
m_filesAnalyzed.insert(filePath);
|
||||
if (!diagnostics.isEmpty())
|
||||
tool()->onNewDiagnosticsAvailable(diagnostics);
|
||||
if (!diagnostics.isEmpty()) {
|
||||
// do not generate marks when we always analyze open files since marks from that
|
||||
// analysis should be more up to date
|
||||
const bool generateMarks = !m_runSettings.analyzeOpenFiles();
|
||||
tool()->onNewDiagnosticsAvailable(diagnostics, generateMarks);
|
||||
}
|
||||
}
|
||||
|
||||
handleFinished();
|
||||
|
||||
Reference in New Issue
Block a user