summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clangd/ClangdTests.cpp
diff options
context:
space:
mode:
authorIlya Biryukov <ibiryukov@google.com>2018-02-12 11:37:28 +0000
committerIlya Biryukov <ibiryukov@google.com>2018-02-12 11:37:28 +0000
commitcd5eb00e8ba9f51a608c0252af31dcb6a911b731 (patch)
treea562da108d6af5b3304a405170bf52499ab40d39 /clang-tools-extra/unittests/clangd/ClangdTests.cpp
parentdc4ed35ea6969a73d64af045d7c624e985d88f5e (diff)
downloadbcm5719-llvm-cd5eb00e8ba9f51a608c0252af31dcb6a911b731.tar.gz
bcm5719-llvm-cd5eb00e8ba9f51a608c0252af31dcb6a911b731.zip
[clangd] Remove codeComplete that returns std::future<>
Summary: It was deprecated and callback version and is used everywhere. Only changes to the testing code were needed. Reviewers: hokein, ioeric, sammccall Reviewed By: sammccall Subscribers: mgorny, klimek, jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D43068 llvm-svn: 324883
Diffstat (limited to 'clang-tools-extra/unittests/clangd/ClangdTests.cpp')
-rw-r--r--clang-tools-extra/unittests/clangd/ClangdTests.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/clang-tools-extra/unittests/clangd/ClangdTests.cpp b/clang-tools-extra/unittests/clangd/ClangdTests.cpp
index bd789002814..6e6f2230755 100644
--- a/clang-tools-extra/unittests/clangd/ClangdTests.cpp
+++ b/clang-tools-extra/unittests/clangd/ClangdTests.cpp
@@ -10,6 +10,7 @@
#include "ClangdLSPServer.h"
#include "ClangdServer.h"
#include "Matchers.h"
+#include "SyncAPI.h"
#include "TestFS.h"
#include "clang/Config/config.h"
#include "llvm/ADT/SmallVector.h"
@@ -302,14 +303,14 @@ TEST_F(ClangdVFSTest, CheckVersions) {
// thread.
FS.Tag = "123";
Server.addDocument(FooCpp, SourceContents);
- EXPECT_EQ(Server.codeComplete(FooCpp, Position{0, 0}, CCOpts).get().Tag,
+ EXPECT_EQ(runCodeComplete(Server, FooCpp, Position{0, 0}, CCOpts).Tag,
FS.Tag);
EXPECT_EQ(DiagConsumer.lastVFSTag(), FS.Tag);
FS.Tag = "321";
Server.addDocument(FooCpp, SourceContents);
EXPECT_EQ(DiagConsumer.lastVFSTag(), FS.Tag);
- EXPECT_EQ(Server.codeComplete(FooCpp, Position{0, 0}, CCOpts).get().Tag,
+ EXPECT_EQ(runCodeComplete(Server, FooCpp, Position{0, 0}, CCOpts).Tag,
FS.Tag);
}
@@ -478,11 +479,10 @@ TEST_F(ClangdVFSTest, InvalidCompileCommand) {
EXPECT_ERROR(Server.rename(FooCpp, Position{0, 0}, "new_name"));
// FIXME: codeComplete and signatureHelp should also return errors when they
// can't parse the file.
- EXPECT_THAT(
- Server.codeComplete(FooCpp, Position{0, 0}, clangd::CodeCompleteOptions())
- .get()
- .Value.items,
- IsEmpty());
+ EXPECT_THAT(runCodeComplete(Server, FooCpp, Position{0, 0},
+ clangd::CodeCompleteOptions())
+ .Value.items,
+ IsEmpty());
auto SigHelp = Server.signatureHelp(FooCpp, Position{0, 0});
ASSERT_TRUE(bool(SigHelp)) << "signatureHelp returned an error";
EXPECT_THAT(SigHelp->Value.signatures, IsEmpty());
@@ -672,10 +672,8 @@ int d;
// requests as opposed to AddDocument/RemoveDocument, which are implicitly
// cancelled by any subsequent AddDocument/RemoveDocument request to the
// same file.
- Server
- .codeComplete(FilePaths[FileIndex], Pos,
- clangd::CodeCompleteOptions())
- .wait();
+ runCodeComplete(Server, FilePaths[FileIndex], Pos,
+ clangd::CodeCompleteOptions());
};
auto FindDefinitionsRequest = [&]() {
OpenPOWER on IntegriCloud