Commit f073aae2 authored by Sergey Kalinichev's avatar Sergey Kalinichev

Sort all completion items by priority

Now items in completion groups are sorted by Clang's completion
priorities.
This should hopefully move the more appropriate items to the top
of the completion list.

Review 124378
parent d92cbd27
......@@ -257,6 +257,11 @@ public:
m_matchQuality = value;
}
void setInheritanceDepth(int depth)
{
m_inheritanceDepth = depth;
}
private:
int m_matchQuality = 0;
QString m_replacement;
......@@ -689,6 +694,8 @@ QList<CompletionTreeItemPointer> ClangCodeCompletionContext::completionItems(boo
if (bestMatch && !found->indexedIdentifier().identifier().toString().startsWith("__") ) {
const int matchQuality = codeCompletionPriorityToMatchQuality(completionPriority);
declarationItem->setMatchQuality(matchQuality);
} else {
declarationItem->setInheritanceDepth(completionPriority);
}
item = declarationItem;
......
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