[CodeCompletion] Don't fuzzy-match on single characters

Use prefix matching on the first character, switch to fuzzy after 2 or
more. With only a single character, we often get silly fuzzy results.
This commit is contained in:
Ben Langmuir
2015-11-06 19:18:55 -08:00
parent 0a82a6fa41
commit 11444373a5
3 changed files with 16 additions and 1 deletions

View File

@@ -488,7 +488,7 @@ void CodeCompletionOrganizer::Impl::addCompletionsWithFilter(
pattern.normalize = true;
for (Completion *completion : completions) {
bool match = false;
if (options.fuzzyMatching) {
if (options.fuzzyMatching && filterText.size() >= options.minFuzzyLength) {
match = pattern.matchesCandidate(completion->getName());
} else {
match = completion->getName().startswith_lower(filterText);