Commit 4a219966 authored by Igor Kushnir's avatar Igor Kushnir

ParseProjectJob: force-update open documents too

When ParseProjectJob's forceUpdate argument is true, closed documents
are parsed with TopDUContext::ForceUpdate feature flag. I think that not
taking into account the forceUpdate argument when parsing open documents
is an omission. Let us parse all documents with the
TopDUContext::ForceUpdate feature flag when forceUpdate is true.
parent 0249d7aa
......@@ -140,12 +140,14 @@ void ParseProjectJob::queueFilesToParse()
minFilesForSimplifiedParsing() ?
TopDUContext::VisibleDeclarationsAndContexts : TopDUContext::
SimplifiedVisibleDeclarationsAndContexts;
TopDUContext::Features openDocumentProcessingLevel{TopDUContext::AllDeclarationsContextsAndUses};
if (d->forceUpdate) {
if (processingLevel & TopDUContext::VisibleDeclarationsAndContexts) {
processingLevel = TopDUContext::AllDeclarationsContextsAndUses;
}
processingLevel = ( TopDUContext::Features )(TopDUContext::ForceUpdate | processingLevel);
openDocumentProcessingLevel = TopDUContext::Features(TopDUContext::ForceUpdate | openDocumentProcessingLevel);
}
if (auto currentDocument = ICore::self()->documentController()->activeDocument()) {
......@@ -153,8 +155,7 @@ void ParseProjectJob::queueFilesToParse()
const auto fileIt = d->filesToParse.constFind(path);
if (fileIt != d->filesToParse.cend()) {
ICore::self()->languageController()->backgroundParser()->addDocument(path,
TopDUContext::AllDeclarationsContextsAndUses, BackgroundParser::BestPriority,
this);
openDocumentProcessingLevel, BackgroundParser::BestPriority, this);
d->filesToParse.erase(fileIt);
}
}
......@@ -166,8 +167,7 @@ void ParseProjectJob::queueFilesToParse()
const auto fileIt = d->filesToParse.constFind(path);
if (fileIt != d->filesToParse.cend()) {
ICore::self()->languageController()->backgroundParser()->addDocument(path,
TopDUContext::AllDeclarationsContextsAndUses, 10,
this);
openDocumentProcessingLevel, 10, this);
d->filesToParse.erase(fileIt);
}
}
......
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