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
|
// We compare proposals by enum values, be careful changing their values
|
||||||
enum class PrefixMatch
|
enum class PrefixMatch
|
||||||
{
|
{
|
||||||
Exact = 0,
|
Full = 0,
|
||||||
Lower = 1,
|
Exact = 1,
|
||||||
None = 2
|
Lower = 2,
|
||||||
|
None = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
AssistProposalItemInterface() = default;
|
AssistProposalItemInterface() = default;
|
||||||
|
|||||||
@@ -316,7 +316,9 @@ void GenericProposalModel::filter(const QString &prefix)
|
|||||||
m_currentItems.append(item);
|
m_currentItems.append(item);
|
||||||
if (text.startsWith(prefix)) {
|
if (text.startsWith(prefix)) {
|
||||||
// Direct match
|
// Direct match
|
||||||
item->setPrefixMatch(AssistProposalItemInterface::PrefixMatch::Exact);
|
item->setPrefixMatch(text.length() == prefix.length()
|
||||||
|
? AssistProposalItemInterface::PrefixMatch::Full
|
||||||
|
: AssistProposalItemInterface::PrefixMatch::Exact);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user