forked from qt-creator/qt-creator
AutoTest: Fix document update handling while code model indexing
Avoid fetching all files for the startup project again and again while code model is indexing files. The indexing emits documentUpdated signals for all (relevant) processed files. If code model is indexing we perform a full parse anyhow after the indexing has finished. Change-Id: Ibfdb47f403da19d5bab3eb2295447ad451fca2b5 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -208,20 +208,15 @@ static void performParse(QFutureInterface<TestParseResultPtr> &futureInterface,
|
|||||||
|
|
||||||
void TestCodeParser::onDocumentUpdated(const QString &fileName)
|
void TestCodeParser::onDocumentUpdated(const QString &fileName)
|
||||||
{
|
{
|
||||||
|
if (m_codeModelParsing || m_fullUpdatePostponed)
|
||||||
|
return;
|
||||||
|
|
||||||
ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
|
ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
|
||||||
if (!project)
|
if (!project)
|
||||||
return;
|
return;
|
||||||
if (!project->files(ProjectExplorer::Project::SourceFiles).contains(fileName))
|
if (!project->files(ProjectExplorer::Project::SourceFiles).contains(fileName))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_codeModelParsing) {
|
|
||||||
if (!m_fullUpdatePostponed) {
|
|
||||||
m_partialUpdatePostponed = true;
|
|
||||||
m_postponedFiles.insert(fileName);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
scanForTests(QStringList(fileName));
|
scanForTests(QStringList(fileName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user