summaryrefslogtreecommitdiffstats
path: root/unittests/clangd/IndexTests.cpp
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2017-12-19 16:50:37 +0000
committerEric Liu <ioeric@google.com>2017-12-19 16:50:37 +0000
commita50f7cf406f7279f4bc875147e72aec4bd423f21 (patch)
tree3d74035ae2436a2da653635dd6c994f6ec7c3509 /unittests/clangd/IndexTests.cpp
parent81a5eb03e612b2aeb88bb6a4d32a26e0b2d9cdb8 (diff)
[clangd] Index-based code completion.
Summary: Use symbol index to populate completion results for qualfified IDs e.g. "nx::A^". Reviewers: ilya-biryukov, sammccall Reviewed By: ilya-biryukov, sammccall Subscribers: rwols, klimek, mgorny, cfe-commits, sammccall Differential Revision: https://reviews.llvm.org/D41281 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321083 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/clangd/IndexTests.cpp')
-rw-r--r--unittests/clangd/IndexTests.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/unittests/clangd/IndexTests.cpp b/unittests/clangd/IndexTests.cpp
index 2852da0b..ea0ea794 100644
--- a/unittests/clangd/IndexTests.cpp
+++ b/unittests/clangd/IndexTests.cpp
@@ -143,7 +143,7 @@ TEST(MemIndexTest, MatchQualifiedNamesWithGlobalScope) {
I.build(generateSymbols({"a::xyz", "b::yz", "yz"}));
FuzzyFindRequest Req;
Req.Query = "y";
- Req.Scopes.push_back("");
+ Req.Scopes = {""};
auto Matches = match(I, Req);
EXPECT_THAT(match(I, Req), UnorderedElementsAre("yz"));
}
@@ -153,7 +153,7 @@ TEST(MemIndexTest, MatchQualifiedNamesWithOneScope) {
I.build(generateSymbols({"a::xyz", "a::yy", "a::xz", "b::yz", "yz"}));
FuzzyFindRequest Req;
Req.Query = "y";
- Req.Scopes.push_back("a");
+ Req.Scopes = {"a"};
auto Matches = match(I, Req);
EXPECT_THAT(match(I, Req), UnorderedElementsAre("a::xyz", "a::yy"));
}
@@ -163,8 +163,7 @@ TEST(MemIndexTest, MatchQualifiedNamesWithMultipleScopes) {
I.build(generateSymbols({"a::xyz", "a::yy", "a::xz", "b::yz", "yz"}));
FuzzyFindRequest Req;
Req.Query = "y";
- Req.Scopes.push_back("a");
- Req.Scopes.push_back("b");
+ Req.Scopes = {"a", "b"};
auto Matches = match(I, Req);
EXPECT_THAT(match(I, Req), UnorderedElementsAre("a::xyz", "a::yy", "b::yz"));
}
@@ -174,7 +173,7 @@ TEST(MemIndexTest, NoMatchNestedScopes) {
I.build(generateSymbols({"a::xyz", "a::b::yy"}));
FuzzyFindRequest Req;
Req.Query = "y";
- Req.Scopes.push_back("a");
+ Req.Scopes = {"a"};
auto Matches = match(I, Req);
EXPECT_THAT(match(I, Req), UnorderedElementsAre("a::xyz"));
}