[PATCH] D84525: [clangd] Add marshalling code for all request types

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 27 04:53:57 PDT 2020


kadircet accepted this revision.
kadircet added a comment.
This revision is now accepted and ready to land.

thanks for bearing with me, LGTM!



================
Comment at: clang-tools-extra/clangd/unittests/remote/MarshallingTests.cpp:277
+  clangd::LookupRequest Request;
+  auto ID = llvm::cantFail(SymbolID::fromStr("0000000000000001"));
+  Request.IDs.insert(ID);
----------------
nit: you could inline these into insert calls now.


================
Comment at: clang-tools-extra/clangd/unittests/remote/MarshallingTests.cpp:290
+
+  Serialized.add_ids("Invalid Symbol ID");
+  Deserialized = ProtobufMarshaller.fromProtobuf(&Serialized);
----------------
looks like you forgot to delete this


================
Comment at: clang-tools-extra/clangd/unittests/remote/MarshallingTests.cpp:335
+  EXPECT_EQ(static_cast<unsigned>(Serialized.ids_size()), Request.IDs.size());
+  EXPECT_EQ(Serialized.limit(), 9000U);
+  auto Deserialized = ProtobufMarshaller.fromProtobuf(&Serialized);
----------------
s/9000U/Request.Limit


================
Comment at: clang-tools-extra/clangd/unittests/remote/MarshallingTests.cpp:340
+  ASSERT_TRUE(Deserialized->Limit);
+  EXPECT_EQ(*Deserialized->Limit, 9000U);
+  EXPECT_EQ(Deserialized->Filter, RefKind::Spelled | RefKind::Declaration);
----------------
s/9000U/Request.Limit




================
Comment at: clang-tools-extra/clangd/unittests/remote/MarshallingTests.cpp:341
+  EXPECT_EQ(*Deserialized->Limit, 9000U);
+  EXPECT_EQ(Deserialized->Filter, RefKind::Spelled | RefKind::Declaration);
+
----------------
s/RefKind::Spelled | RefKind::Declaration/Request.Filter


================
Comment at: clang-tools-extra/clangd/unittests/remote/MarshallingTests.cpp:343
+
+  Serialized.add_ids("Invalid Symbol ID");
+  Deserialized = ProtobufMarshaller.fromProtobuf(&Serialized);
----------------
again you forgot to delete this


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84525/new/

https://reviews.llvm.org/D84525





More information about the cfe-commits mailing list