summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppsemanticinfoupdater.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2014-11-19 12:07:29 +0100
committerNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2014-11-19 16:10:56 +0100
commitbeac7b9539457fe721de1709b9a406cac2379851 (patch)
tree49d8d0ff08d024566f163228dfb317636019c88c /src/plugins/cpptools/cppsemanticinfoupdater.cpp
parent687fda833a3088d45c0c1f9a38c7594eecaee254 (diff)
downloadqt-creator-beac7b9539457fe721de1709b9a406cac2379851.tar.gz
C++: Fix highlighting after "invalid code"
For the semantic info document we do not expand function like macros and because of that certain macro invocations lead to invalid code that we need to handle, e.g.: Q_GLOBAL_STATIC(CppTools::SymbolFinder, symbolFinder) class Foo {}; This change makes parsing Foo in the semantic info document successfully again, which affects highlighting of that class. Change-Id: I389265ac64d3f0b8b8f406d38fa58d78820b14ba Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'src/plugins/cpptools/cppsemanticinfoupdater.cpp')
-rw-r--r--src/plugins/cpptools/cppsemanticinfoupdater.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppsemanticinfoupdater.cpp b/src/plugins/cpptools/cppsemanticinfoupdater.cpp
index 2ee0501aa7..9c9d87ac6a 100644
--- a/src/plugins/cpptools/cppsemanticinfoupdater.cpp
+++ b/src/plugins/cpptools/cppsemanticinfoupdater.cpp
@@ -125,6 +125,7 @@ SemanticInfo SemanticInfoUpdaterPrivate::update(const SemanticInfo::Source &sour
Document::Ptr doc = newSemanticInfo.snapshot.preprocessedDocument(source.code, source.fileName);
if (processor)
doc->control()->setTopLevelDeclarationProcessor(processor);
+ doc->setRetryHarderToParseDeclarations(true);
doc->check();
if (processor && processor->isCanceled())
newSemanticInfo.complete = false;