forked from qt-creator/qt-creator
Clang: Fix updating supportive translation unit
...with new project arguments.
Reproduce with:
1. Open a file with some #ifdef
2. Edit the file, e.g. type space.
3. Change the build configuration so that the highlighting flips in the
editor.
4. Edit the file again, the configuration flips again [repeat].
Change-Id: Ib97c18fc46538d74c63972e682a348ae2736a4e6
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
#include <updatetranslationunitsforeditormessage.h>
|
||||
#include <updatevisibletranslationunitsmessage.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
@@ -155,7 +156,16 @@ void ClangCodeModelServer::registerProjectPartsForEditor(const RegisterProjectPa
|
||||
|
||||
try {
|
||||
projects.createOrUpdate(message.projectContainers());
|
||||
documents.setDocumentsDirtyIfProjectPartChanged();
|
||||
std::vector<Document> affectedDocuments = documents.setDocumentsDirtyIfProjectPartChanged();
|
||||
|
||||
for (Document &document : affectedDocuments) {
|
||||
document.setResponsivenessIncreaseNeeded(document.isResponsivenessIncreased());
|
||||
|
||||
documentProcessors().remove(document);
|
||||
document.translationUnits().removeAll();
|
||||
document.translationUnits().createAndAppend();
|
||||
documentProcessors().create(document);
|
||||
}
|
||||
|
||||
processJobsForDirtyAndVisibleDocuments();
|
||||
} catch (const std::exception &exception) {
|
||||
|
||||
Reference in New Issue
Block a user