forked from qt-creator/qt-creator
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 <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user