[clang-tools-extra] r346671 - [clangd] Don't show all refs results if -name is ambiguous in dexp.
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 12 08:41:15 PST 2018
Author: hokein
Date: Mon Nov 12 08:41:15 2018
New Revision: 346671
URL: http://llvm.org/viewvc/llvm-project?rev=346671&view=rev
Log:
[clangd] Don't show all refs results if -name is ambiguous in dexp.
Reviewers: ioeric
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D54430
Modified:
clang-tools-extra/trunk/clangd/index/dex/dexp/Dexp.cpp
Modified: clang-tools-extra/trunk/clangd/index/dex/dexp/Dexp.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/index/dex/dexp/Dexp.cpp?rev=346671&r1=346670&r2=346671&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/index/dex/dexp/Dexp.cpp (original)
+++ clang-tools-extra/trunk/clangd/index/dex/dexp/Dexp.cpp Mon Nov 12 08:41:15 2018
@@ -218,6 +218,12 @@ class Refs : public Command {
IDs.push_back(*SID);
} else {
IDs = getSymbolIDsFromIndex(Name, Index);
+ if (IDs.size() > 1) {
+ outs() << formatv("The name {0} is ambiguous, found {1} different "
+ "symbols. Please use id flag to disambiguate.\n",
+ Name, IDs.size());
+ return;
+ }
}
RefsRequest RefRequest;
RefRequest.IDs.insert(IDs.begin(), IDs.end());
More information about the cfe-commits
mailing list