[PATCH] D54106: [clangd] Limit the index-returned results in dexp.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 5 08:08:56 PST 2018

hokein created this revision.
hokein added a reviewer: ioeric.
Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ilya-biryukov.

When the limit of FuzzyFindRequest is not specified, MemIndex and
DexIndex will set it MAX_UINT, which doesn't make sense in the active tool dexp
(we might get lots results). This patch restricts it to a small number.

  rCTE Clang Tools Extra



Index: clangd/index/dex/dexp/Dexp.cpp
--- clangd/index/dex/dexp/Dexp.cpp
+++ clangd/index/dex/dexp/Dexp.cpp
@@ -52,6 +52,7 @@
 std::vector<SymbolID> getSymbolIDsFromIndex(StringRef QualifiedName,
                                             const SymbolIndex *Index) {
   FuzzyFindRequest Request;
+  Request.Limit = 10;
   // Remove leading "::" qualifier as FuzzyFind doesn't need leading "::"
   // qualifier for global scope.
   bool IsGlobalScope = QualifiedName.consume_front("::");

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54106.172593.patch
Type: text/x-patch
Size: 557 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181105/53e2b5e4/attachment-0001.bin>

More information about the cfe-commits mailing list