forked from qt-creator/qt-creator
Revert "CppTools: Do not put configuration document into global snapshot and working copy"
This reverts commit 05942b63f8
because it
breaks refactoring, e.g. Q_PROPERTY generators.
Change-Id: I9a14b912ba72663f08ea99e7e066d824b18da4b0
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -594,6 +594,11 @@ WorkingCopy CppModelManager::buildWorkingCopyList()
|
||||
workingCopy.insert(es->fileName(), es->contents(), es->revision());
|
||||
}
|
||||
|
||||
// Add the project configuration file
|
||||
QByteArray conf = codeModelConfiguration();
|
||||
conf += definedMacros();
|
||||
workingCopy.insert(configurationFileName(), conf);
|
||||
|
||||
return workingCopy;
|
||||
}
|
||||
|
||||
@@ -871,6 +876,12 @@ QFuture<void> CppModelManager::updateProjectInfo(QFutureInterface<void> &futureI
|
||||
removeProjectInfoFilesAndIncludesFromSnapshot(oldProjectInfo);
|
||||
filesToReindex.unite(newSourceFiles);
|
||||
|
||||
// The "configuration file" includes all defines and therefore should be updated
|
||||
if (comparer.definesChanged()) {
|
||||
QMutexLocker snapshotLocker(&d->m_snapshotMutex);
|
||||
d->m_snapshot.remove(configurationFileName());
|
||||
}
|
||||
|
||||
// Otherwise check for added and modified files
|
||||
} else {
|
||||
const QSet<QString> addedFiles = comparer.addedFiles();
|
||||
@@ -999,9 +1010,6 @@ bool CppModelManager::isClangCodeModelActive() const
|
||||
|
||||
void CppModelManager::emitDocumentUpdated(Document::Ptr doc)
|
||||
{
|
||||
if (Client::isInjectedFile(doc->fileName()))
|
||||
return;
|
||||
|
||||
if (replaceDocument(doc))
|
||||
emit documentUpdated(doc);
|
||||
}
|
||||
|
Reference in New Issue
Block a user