forked from qt-creator/qt-creator
Clang: Send the diagnostics delayed
Change-Id: I6065e51d38c262cf59d977c11c6453dec85a6dfe Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user