Added a new fuzzy matching algorithm, it should be better than the previous version, it's similar to what most editors have (implementation is inspired in the sublime_text fuzzy matcher).

This commit is contained in:
Martín Lucas Golini
2025-03-08 18:33:25 -03:00
parent 0dba4a222b
commit dfb0820d0f
12 changed files with 305 additions and 59 deletions

View File

@@ -410,7 +410,7 @@ PluginRequestHandle LSPClientPlugin::processWorkspaceSymbol( const PluginMessage
if ( !query.empty() ) {
for ( auto& i : info ) {
if ( i.score == 0.f )
i.score = String::fuzzyMatch( i.name, query );
i.score = String::fuzzyMatch( query, i.name );
}
}
mManager->sendResponse( this, PluginMessageType::WorkspaceSymbol,
@@ -422,7 +422,7 @@ PluginRequestHandle LSPClientPlugin::processWorkspaceSymbol( const PluginMessage
if ( !query.empty() ) {
for ( auto& i : info ) {
if ( i.score == 0.f )
i.score = String::fuzzyMatch( i.name, query );
i.score = String::fuzzyMatch( query, i.name );
}
}
mManager->sendResponse( this, PluginMessageType::WorkspaceSymbol,