Clang: Send the diagnostics delayed

Change-Id: I6065e51d38c262cf59d977c11c6453dec85a6dfe
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Marco Bubke
2015-08-26 16:33:32 +02:00
parent aa300e363f
commit 0267f2861d
6 changed files with 68 additions and 13 deletions

View File

@@ -63,6 +63,12 @@ ClangIpcServer::ClangIpcServer()
{
client()->diagnosticsChanged(message);
});
sendDiagnosticsTimer.setInterval(2000);
sendDiagnosticsTimer.setSingleShot(true);
QObject::connect(&sendDiagnosticsTimer,
&QTimer::timeout,
[this] () { translationUnits.sendChangedDiagnostics(); });
}
void ClangIpcServer::end()
@@ -79,6 +85,7 @@ void ClangIpcServer::registerTranslationUnitsForCodeCompletion(const ClangBackEn
if (newerFileContainers.size() > 0) {
unsavedFiles.createOrUpdate(newerFileContainers);
translationUnits.createOrUpdate(newerFileContainers);
sendDiagnosticsTimer.start();
}
} catch (const ProjectPartDoNotExistException &exception) {
client()->projectPartsDoNotExist(ProjectPartsDoNotExistMessage(exception.projectPartIds()));