Commit 4e18e9cd authored by Marco Bubke's avatar Marco Bubke

Clang: Only get one diagnostic for a time out

Otherwise we can stall the backend process.

Change-Id: I854d117546ad08026be8a42854739cabad8b67fd
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent 283ddb8d
......@@ -30,6 +30,7 @@
#include "clangipcserver.h"
#include "clangfilesystemwatcher.h"
#include "codecompleter.h"
#include "diagnosticset.h"
#include "projectpartsdonotexistexception.h"
......@@ -64,8 +65,7 @@ ClangIpcServer::ClangIpcServer()
client()->diagnosticsChanged(message);
});
sendDiagnosticsTimer.setInterval(2000);
sendDiagnosticsTimer.setSingleShot(true);
sendDiagnosticsTimer.setInterval(1000);
QObject::connect(&sendDiagnosticsTimer,
&QTimer::timeout,
[this] () { translationUnits.sendChangedDiagnostics(); });
......
......@@ -136,8 +136,10 @@ void TranslationUnits::updateTranslationUnitsWithChangedDependencies(const Utf8S
void TranslationUnits::sendChangedDiagnostics()
{
for (const auto &translationUnit : translationUnits_) {
if (translationUnit.hasNewDiagnostics())
if (translationUnit.hasNewDiagnostics()) {
sendDiagnosticChangedMessage(translationUnit);
break;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment