| 88 | }; |
| 89 | |
| 90 | LSPSymbolInformationList fuzzyMatchTextDocumentSymbol( const LSPSymbolInformationList& list, |
| 91 | const std::string& query, |
| 92 | const size_t& limit ) { |
| 93 | LSPSymbolInformationList nl; |
| 94 | std::map<int, LSPSymbolInformation, std::greater<int>> matchesMap; |
| 95 | |
| 96 | for ( const auto& l : list ) { |
| 97 | int score = String::fuzzyMatch( query, l.name ); |
| 98 | if ( score > std::numeric_limits<int>::min() ) |
| 99 | matchesMap.insert( { score, l } ); |
| 100 | } |
| 101 | |
| 102 | for ( auto& m : matchesMap ) { |
| 103 | m.second.score = m.first; |
| 104 | nl.emplace_back( std::move( m.second ) ); |
| 105 | } |
| 106 | return nl; |
| 107 | } |
| 108 | |
| 109 | static constexpr auto LOCATEBAR_MAX_VISIBLE_ITEMS = 18; |
| 110 | static constexpr auto LOCATEBAR_MAX_RESULTS = 100; |
no test coverage detected