Commit f878da0e authored by Nikolai Kosjar's avatar Nikolai Kosjar

CppTools: Offer "override" and "final" as completion items

These are special identifiers and were thus not included in the 'add all
keywords' handling.

Change-Id: I7f65df5711193e945bfa955dcb70a6ab454606b5
Task-number: QTCREATORBUG-11341
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@theqtcompany.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent cea5d886
......@@ -168,6 +168,8 @@ bool isProbablyGlobalCompletion(const QStringList &list)
+ (T_FIRST_OBJC_AT_KEYWORD - T_FIRST_KEYWORD);
return list.size() >= numberOfPrimitivesAndBasicKeywords
&& list.contains(QLatin1String("override"))
&& list.contains(QLatin1String("final"))
&& list.contains(QLatin1String("if"))
&& list.contains(QLatin1String("bool"));
}
......
......@@ -1937,6 +1937,12 @@ void InternalCppCompletionAssistProcessor::addKeywords()
// primitive type completion items.
for (int i = T_FIRST_PRIMITIVE; i <= T_LAST_PRIMITIVE; ++i)
addCompletionItem(QLatin1String(Token::name(i)), m_icons.keywordIcon(), KeywordsOrder);
// "Identifiers with special meaning"
if (m_interface->languageFeatures().cxx11Enabled) {
addCompletionItem(QLatin1String("override"), m_icons.keywordIcon(), KeywordsOrder);
addCompletionItem(QLatin1String("final"), m_icons.keywordIcon(), KeywordsOrder);
}
}
void InternalCppCompletionAssistProcessor::addMacros(const QString &fileName,
......
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