Chat history WIP.

Reverted completion fuzzy search.
This commit is contained in:
Martín Lucas Golini
2025-03-23 03:37:34 -03:00
parent 12b2114a56
commit cfd66fa438
13 changed files with 366 additions and 23 deletions

View File

@@ -55,20 +55,21 @@ fuzzyMatchSymbols( const std::vector<const AutoCompletePlugin::SymbolsList*>& sy
for ( const auto& symbols : symbolsVec ) {
for ( const auto& symbol : *symbols ) {
if ( symbol.kind == LSPCompletionItemKind::Snippet ||
( score = String::fuzzyMatch( pattern, symbol.text ) ) >
std::numeric_limits<int>::min() ) {
( score = String::fuzzyMatchSimple(
pattern, symbol.text, false, symbol.kind != LSPCompletionItemKind::Text ) ) >
0 ) {
if ( std::find( matches.begin(), matches.end(), symbol ) == matches.end() ) {
symbol.setScore( score +
( symbol.kind != LSPCompletionItemKind::Text ? 100 : 0 ) );
( symbol.kind != LSPCompletionItemKind::Text ? score : 0 ) );
matches.push_back( symbol );
if ( matches.size() > max )
if ( matches.size() >= max )
break;
}
}
}
if ( matches.size() > max )
if ( matches.size() >= max )
break;
}