[PATCH] D97773: [clangd] Make WorkspaceSymbols request work with empty queries
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 3 06:46:24 PST 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG188373fb4697: [clangd] Make WorkspaceSymbols request work with empty queries (authored by kadircet).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97773/new/
https://reviews.llvm.org/D97773
Files:
clang-tools-extra/clangd/FindSymbols.cpp
clang-tools-extra/clangd/unittests/FindSymbolsTests.cpp
Index: clang-tools-extra/clangd/unittests/FindSymbolsTests.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/FindSymbolsTests.cpp
+++ clang-tools-extra/clangd/unittests/FindSymbolsTests.cpp
@@ -216,7 +216,9 @@
AllOf(QName("foo"), WithKind(SymbolKind::Function)),
AllOf(QName("ns"), WithKind(SymbolKind::Namespace))));
EXPECT_THAT(getSymbols(TU, ":"), IsEmpty());
- EXPECT_THAT(getSymbols(TU, ""), IsEmpty());
+ EXPECT_THAT(getSymbols(TU, ""),
+ UnorderedElementsAre(QName("foo"), QName("Foo"), QName("Foo::a"),
+ QName("ns"), QName("ns::foo2")));
}
TEST(WorkspaceSymbols, Enums) {
Index: clang-tools-extra/clangd/FindSymbols.cpp
===================================================================
--- clang-tools-extra/clangd/FindSymbols.cpp
+++ clang-tools-extra/clangd/FindSymbols.cpp
@@ -88,7 +88,7 @@
getWorkspaceSymbols(llvm::StringRef Query, int Limit,
const SymbolIndex *const Index, llvm::StringRef HintPath) {
std::vector<SymbolInformation> Result;
- if (Query.empty() || !Index)
+ if (!Index)
return Result;
// Lookup for qualified names are performed as:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97773.327776.patch
Type: text/x-patch
Size: 1258 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210303/d38217cf/attachment.bin>
More information about the cfe-commits
mailing list