diff options
author | Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> | 2014-11-19 12:07:29 +0100 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> | 2014-11-19 16:10:56 +0100 |
commit | beac7b9539457fe721de1709b9a406cac2379851 (patch) | |
tree | 49d8d0ff08d024566f163228dfb317636019c88c /src/libs/cplusplus/CppDocument.cpp | |
parent | 687fda833a3088d45c0c1f9a38c7594eecaee254 (diff) | |
download | qt-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/libs/cplusplus/CppDocument.cpp')
-rw-r--r-- | src/libs/cplusplus/CppDocument.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index 6c51ff5f3b..3eea3c80c1 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -623,6 +623,13 @@ void Document::tokenize() _translationUnit->tokenize(); } +void Document::setRetryHarderToParseDeclarations(bool yesno) +{ + _translationUnit->setRetryParseDeclarationLimit( + yesno ? 1000 + : TranslationUnit::defaultRetryParseDeclarationLimit()); +} + bool Document::isParsed() const { return _translationUnit->isParsed(); |