ecode: Improvements for the root path handling. Improvements for the workspace symbol search.

This commit is contained in:
Martín Lucas Golini
2023-03-02 03:35:15 -03:00
parent 323c3ebc01
commit 344d1c72f8
7 changed files with 68 additions and 17 deletions

View File

@@ -259,10 +259,16 @@ PluginRequestHandle LSPClientPlugin::processWorkspaceSymbol( const PluginMessage
if ( servers.empty() )
return {};
std::string query = msg.asJSON().value( "query", "" );
for ( const auto server : servers ) {
server->workspaceSymbol(
msg.asJSON().value( "query", "" ),
[&]( const PluginIDType& id, const LSPSymbolInformationList& info ) {
query, [&, query]( const PluginIDType& id, LSPSymbolInformationList&& info ) {
if ( !query.empty() ) {
for ( auto& i : info ) {
if ( i.score == 0.f )
i.score = String::fuzzyMatch( i.name, query );
}
}
mManager->sendResponse( this, PluginMessageType::WorkspaceSymbol,
PluginMessageFormat::SymbolInformation, &info, id );
} );