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>
This commit is contained in:
Nikolai Kosjar
2014-11-19 12:07:29 +01:00
parent 687fda833a
commit beac7b9539
8 changed files with 49 additions and 9 deletions

View File

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