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>
This commit is contained in:
Nikolai Kosjar
2014-10-14 11:37:40 +02:00
parent 756fba0dfb
commit 0c107b33d1
3 changed files with 9 additions and 1 deletions

View File

@@ -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;