summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppsemanticinfoupdater.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@digia.com>2014-10-14 11:37:40 +0200
committerNikolai Kosjar <nikolai.kosjar@digia.com>2014-10-15 10:33:27 +0200
commit0c107b33d1578263d858f446458b60278267154f (patch)
treec8363d41695cc73278f2527a2b929fb9f1c90244 /src/plugins/cpptools/cppsemanticinfoupdater.cpp
parent756fba0dfbb4e5ad9fae07ba24d903cb986cec99 (diff)
downloadqt-creator-0c107b33d1578263d858f446458b60278267154f.tar.gz
CppTools: Do not re-use semantic document if dependencies changed
Changes from the current editor snapshot to the previous one represent dependency changes (include paths, defines, ...) for the document. Use this to stop the semantic info updater from re-using the previous document for highlighthing. Task-number: QTCREATORBUG-12267 Change-Id: I91308700122ded7c458c267b685c00b966874a64 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Diffstat (limited to 'src/plugins/cpptools/cppsemanticinfoupdater.cpp')
-rw-r--r--src/plugins/cpptools/cppsemanticinfoupdater.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/cpptools/cppsemanticinfoupdater.cpp b/src/plugins/cpptools/cppsemanticinfoupdater.cpp
index 6c1cda731e..f05f0d5d82 100644
--- a/src/plugins/cpptools/cppsemanticinfoupdater.cpp
+++ b/src/plugins/cpptools/cppsemanticinfoupdater.cpp
@@ -148,7 +148,8 @@ bool SemanticInfoUpdaterPrivate::reuseCurrentSemanticInfo(const SemanticInfo::So
&& currentSemanticInfo.doc
&& currentSemanticInfo.doc->translationUnit()->ast()
&& currentSemanticInfo.doc->fileName() == source.fileName
- && !currentSemanticInfo.snapshot.isEmpty()) {
+ && !currentSemanticInfo.snapshot.isEmpty()
+ && currentSemanticInfo.snapshot == source.snapshot) {
SemanticInfo newSemanticInfo;
newSemanticInfo.revision = source.revision;
newSemanticInfo.snapshot = source.snapshot;