[PATCH] D55705: [dexp] Change FuzzyFind to also print scope of symbols

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 14 06:11:15 PST 2018


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

When there are multiple symbols in the result of a fuzzy find with the
same name, one has to perform an additional query to figure out which of those
symbols are coming from the "interesting" scope. This patch prints the scope in
fuzzy find results to get rid of the second symbol.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D55705

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
@@ -149,7 +149,8 @@
     outs() << formatv(OutputFormat, "Rank", "Symbol ID", "Symbol Name");
     size_t Rank = 0;
     Index->fuzzyFind(Request, [&](const Symbol &Sym) {
-      outs() << formatv(OutputFormat, Rank++, Sym.ID.str(), Sym.Name);
+      outs() << formatv(OutputFormat, Rank++, Sym.ID.str(),
+                        Sym.Scope + Sym.Name);
     });
   }
 };


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55705.178228.patch
Type: text/x-patch
Size: 547 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181214/c1411c51/attachment.bin>


More information about the cfe-commits mailing list