Commit 48392fac authored by Ivan Donchevskii's avatar Ivan Donchevskii
Browse files

Clang: Show full completion match first



If prefix is equal to some completion then show it
before anything else.

Task-number: QTCREATORBUG-15445
Change-Id: I976da4a829b818e843d31a76d2818eb5bbedda93
Reviewed-by: Nikolai Kosjar's avatarNikolai Kosjar <nikolai.kosjar@qt.io>
parent 8922fbf4
......@@ -47,9 +47,10 @@ public:
// We compare proposals by enum values, be careful changing their values
enum class PrefixMatch
{
Exact = 0,
Lower = 1,
None = 2
Full = 0,
Exact = 1,
Lower = 2,
None = 3
};
AssistProposalItemInterface() = default;
......
......@@ -316,7 +316,9 @@ void GenericProposalModel::filter(const QString &prefix)
m_currentItems.append(item);
if (text.startsWith(prefix)) {
// Direct match
item->setPrefixMatch(AssistProposalItemInterface::PrefixMatch::Exact);
item->setPrefixMatch(text.length() == prefix.length()
? AssistProposalItemInterface::PrefixMatch::Full
: AssistProposalItemInterface::PrefixMatch::Exact);
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