Commit f0464333 authored by Igor Kushnir's avatar Igor Kushnir

ParseProjectJob: don't skip parsing the last few files

ParseProjectJob::queueFilesToParse() removes the currently open
documents that belong to the project from d->filesToParse. Therefore,
when ParseProjectJob::updateReady() is invoked, the actual number of
files to parse can be greater than d->filesToParse.size().
ParseProjectJob reverts all its requests in the destructor, so the few
unaccounted-for closed documents could remain unparsed.
parent e93f0c85
......@@ -47,9 +47,9 @@ public:
{
}
int updated = 0;
bool forceUpdate;
bool parseAllProjectSources;
int fileCountLeftToParse = 0;
QSet<IndexedString> filesToParse;
};
......@@ -81,6 +81,7 @@ ParseProjectJob::ParseProjectJob(IProject* project, bool forceUpdate, bool parse
}
}
}
d->fileCountLeftToParse = d->filesToParse.size();
setCapabilities(Killable);
......@@ -93,9 +94,11 @@ void ParseProjectJob::updateReady(const IndexedString& url, const ReferencedTopD
Q_UNUSED(url);
Q_UNUSED(topContext);
++d->updated;
if (d->updated >= d->filesToParse.size())
--d->fileCountLeftToParse;
Q_ASSERT(d->fileCountLeftToParse >= 0);
if (d->fileCountLeftToParse == 0) {
deleteLater();
}
}
void ParseProjectJob::start()
......
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