forked from qt-creator/qt-creator
		
	Revert "Split Objective-C keyword parsing to handle the '@' separately."
This reverts commit 2a59d2ae0c.
			
			
This commit is contained in:
		@@ -1197,35 +1197,18 @@ bool CppCodeCompletion::completeScope(const QList<LookupItem> &results,
 | 
			
		||||
    return ! m_completions.isEmpty();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void CppCodeCompletion::addKeyword(const QString &text)
 | 
			
		||||
{
 | 
			
		||||
    TextEditor::CompletionItem item(this);
 | 
			
		||||
    item.text = text;
 | 
			
		||||
    item.icon = m_icons.keywordIcon();
 | 
			
		||||
    m_completions.append(item);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void CppCodeCompletion::addKeywords()
 | 
			
		||||
{
 | 
			
		||||
    int keywordLimit = T_FIRST_OBJC_AT_KEYWORD;
 | 
			
		||||
    if (objcKeywordsWanted())
 | 
			
		||||
        keywordLimit = T_LAST_OBJC_AT_KEYWORD + 1;
 | 
			
		||||
 | 
			
		||||
    // keyword completion items.
 | 
			
		||||
    for (int i = T_FIRST_KEYWORD; i < T_FIRST_OBJC_KEYWORD; ++i) {
 | 
			
		||||
        addKeyword(QLatin1String(Token::name(i)));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (objcKeywordsWanted()) {
 | 
			
		||||
        // unique Objective-C keywords:
 | 
			
		||||
        for (int i = T_FIRST_OBJC_KEYWORD; i <= T_LAST_OBJC_KEYWORD; ++i) {
 | 
			
		||||
            addKeyword(QLatin1Char('@') + QLatin1String(Token::name(i)));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // overlapping keywords:
 | 
			
		||||
        addKeyword(QLatin1Char('@') + QLatin1String(Token::name(T_CATCH)));
 | 
			
		||||
        addKeyword(QLatin1Char('@') + QLatin1String(Token::name(T_CLASS)));
 | 
			
		||||
        addKeyword(QLatin1Char('@') + QLatin1String(Token::name(T_PRIVATE)));
 | 
			
		||||
        addKeyword(QLatin1Char('@') + QLatin1String(Token::name(T_PROTECTED)));
 | 
			
		||||
        addKeyword(QLatin1Char('@') + QLatin1String(Token::name(T_PUBLIC)));
 | 
			
		||||
        addKeyword(QLatin1Char('@') + QLatin1String(Token::name(T_THROW)));
 | 
			
		||||
        addKeyword(QLatin1Char('@') + QLatin1String(Token::name(T_TRY)));
 | 
			
		||||
    for (int i = T_FIRST_KEYWORD; i < keywordLimit; ++i) {
 | 
			
		||||
        TextEditor::CompletionItem item(this);
 | 
			
		||||
        item.text = QLatin1String(Token::name(i));
 | 
			
		||||
        item.icon = m_icons.keywordIcon();
 | 
			
		||||
        m_completions.append(item);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -89,7 +89,6 @@ public:
 | 
			
		||||
    void setPartialCompletionEnabled(bool partialCompletionEnabled);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    void addKeyword(const QString &text);
 | 
			
		||||
    void addKeywords();
 | 
			
		||||
    void addMacros(const QString &fileName, const CPlusPlus::Snapshot &snapshot);
 | 
			
		||||
    void addMacros_helper(const CPlusPlus::Snapshot &snapshot,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user