[PATCH] D54427: [clangd] Allow symbols from AnyScope in dexp.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 12 07:39:54 PST 2018


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

We should allow symbols from any scope in dexp results, othewise
`find StringRef` doesn't return any results (llvm::StringRef).


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D54427

Files:
  clangd/index/dex/dexp/Dexp.cpp


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.AnyScope = true;
   // Remove leading "::" qualifier as FuzzyFind doesn't need leading "::"
   // qualifier for global scope.
   bool IsGlobalScope = QualifiedName.consume_front("::");
@@ -134,6 +135,7 @@
     FuzzyFindRequest Request;
     Request.Limit = Limit;
     Request.Query = Query;
+    Request.AnyScope = true;
     if (Scopes.getNumOccurrences() > 0) {
       SmallVector<StringRef, 8> Scopes;
       StringRef(this->Scopes).split(Scopes, ',');


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54427.173673.patch
Type: text/x-patch
Size: 834 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181112/fdc4499f/attachment.bin>


More information about the cfe-commits mailing list