CodeAssist: Ensure perfect match for keywords

...as otherwise the completion windows stays open and gets in the way.

Fixes: QTCREATORBUG-21767
Change-Id: Ib0a841b9d9de52109439f067c466478744361814
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Nikolai Kosjar
2019-05-22 10:21:56 +02:00
parent 76d44aea0d
commit 975173af11
6 changed files with 35 additions and 7 deletions

View File

@@ -214,8 +214,13 @@ bool GenericProposalModel::isPerfectMatch(const QString &prefix) const
if (match == PerfectMatchType::StartsWith)
return false;
if (!hasFullMatch && match == PerfectMatchType::Full)
hasFullMatch = true;
if (match == PerfectMatchType::Full) {
if (proposalItem(i)->isKeyword())
return true;
if (!hasFullMatch)
hasFullMatch = true;
}
}
return hasFullMatch;