diff options
Diffstat (limited to 'clang-tools-extra/clangd/index/dex/DexIndex.cpp')
| -rw-r--r-- | clang-tools-extra/clangd/index/dex/DexIndex.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang-tools-extra/clangd/index/dex/DexIndex.cpp b/clang-tools-extra/clangd/index/dex/DexIndex.cpp index 847fa02c39f..534f51e0c3d 100644 --- a/clang-tools-extra/clangd/index/dex/DexIndex.cpp +++ b/clang-tools-extra/clangd/index/dex/DexIndex.cpp @@ -125,11 +125,15 @@ bool DexIndex::fuzzyFind( // using 100x of the requested number might not be good in practice, e.g. // when the requested number of items is small. const unsigned ItemsToRetrieve = 100 * Req.MaxCandidateCount; - std::vector<DocID> SymbolDocIDs = consume(*QueryIterator, ItemsToRetrieve); + // FIXME(kbobyrev): Add boosting to the query and utilize retrieved + // boosting scores. + std::vector<std::pair<DocID, float>> SymbolDocIDs = + consume(*QueryIterator, ItemsToRetrieve); // Retrieve top Req.MaxCandidateCount items. std::priority_queue<std::pair<float, const Symbol *>> Top; - for (const auto &SymbolDocID : SymbolDocIDs) { + for (const auto &P : SymbolDocIDs) { + const DocID SymbolDocID = P.first; const auto *Sym = (*Symbols)[SymbolDocID]; const llvm::Optional<float> Score = Filter.match(Sym->Name); if (!Score) @@ -161,7 +165,6 @@ void DexIndex::lookup(const LookupRequest &Req, } } - void DexIndex::findOccurrences( const OccurrencesRequest &Req, llvm::function_ref<void(const SymbolOccurrence &)> Callback) const { |

