Commit 286f863f authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

CppTools: Use correct language features in createHighlighter

Change-Id: Ia8971dbc9be18575a1b22d46dac5bb8c18c63c7a
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent c947f1f8
......@@ -78,23 +78,20 @@ CppTools::CheckSymbols *createHighlighter(const CPlusPlus::Document::Ptr &doc,
macroUses.append(use);
}
const LanguageFeatures features = doc->languageFeatures();
// Get macro uses
foreach (const Document::MacroUse &macro, doc->macroUses()) {
const QString name = macro.macro().nameToQString();
//Filter out QtKeywords
if (isQtKeyword(QStringRef(&name)))
if (features.qtKeywordsEnabled && isQtKeyword(QStringRef(&name)))
continue;
// Filter out C++ keywords
// FIXME: Check default values or get from document.
LanguageFeatures features;
features.cxx11Enabled = true;
features.c99Enabled = true;
SimpleLexer tokenize;
tokenize.setLanguageFeatures(features);
// Filter out C++ keywords
const Tokens tokens = tokenize(name);
if (tokens.length() && (tokens.at(0).isKeyword() || tokens.at(0).isObjCAtKeyword()))
continue;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment