[PATCH] D89851: [clangd] Separate final_result into a different message; NFC

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 25 01:24:09 PDT 2020


kbobyrev updated this revision to Diff 300528.
kbobyrev added a comment.

Rebase on top of master, use proto2 syntax.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89851

Files:
  clang-tools-extra/clangd/index/remote/Client.cpp
  clang-tools-extra/clangd/index/remote/Index.proto
  clang-tools-extra/clangd/index/remote/server/Server.cpp


Index: clang-tools-extra/clangd/index/remote/server/Server.cpp
===================================================================
--- clang-tools-extra/clangd/index/remote/server/Server.cpp
+++ clang-tools-extra/clangd/index/remote/server/Server.cpp
@@ -109,7 +109,7 @@
       ++Sent;
     });
     LookupReply LastMessage;
-    LastMessage.set_final_result(true);
+    LastMessage.mutable_result()->set_has_more(true);
     Reply->Write(LastMessage);
     SPAN_ATTACH(Tracer, "Sent", Sent);
     SPAN_ATTACH(Tracer, "Failed to send", FailedToSend);
@@ -142,7 +142,7 @@
       ++Sent;
     });
     FuzzyFindReply LastMessage;
-    LastMessage.set_final_result(HasMore);
+    LastMessage.mutable_result()->set_has_more(HasMore);
     Reply->Write(LastMessage);
     SPAN_ATTACH(Tracer, "Sent", Sent);
     SPAN_ATTACH(Tracer, "Failed to send", FailedToSend);
@@ -173,7 +173,7 @@
       ++Sent;
     });
     RefsReply LastMessage;
-    LastMessage.set_final_result(HasMore);
+    LastMessage.mutable_result()->set_has_more(HasMore);
     Reply->Write(LastMessage);
     SPAN_ATTACH(Tracer, "Sent", Sent);
     SPAN_ATTACH(Tracer, "Failed to send", FailedToSend);
@@ -207,7 +207,7 @@
           ++Sent;
         });
     RelationsReply LastMessage;
-    LastMessage.set_final_result(true);
+    LastMessage.mutable_result()->set_has_more(true);
     Reply->Write(LastMessage);
     SPAN_ATTACH(Tracer, "Sent", Sent);
     SPAN_ATTACH(Tracer, "Failed to send", FailedToSend);
Index: clang-tools-extra/clangd/index/remote/Index.proto
===================================================================
--- clang-tools-extra/clangd/index/remote/Index.proto
+++ clang-tools-extra/clangd/index/remote/Index.proto
@@ -12,12 +12,14 @@
 
 message LookupRequest { repeated string ids = 1; }
 
+message FinalResult { optional bool has_more = 1; }
+
 // The response is a stream of symbol messages and the terminating message
 // indicating the end of stream.
 message LookupReply {
   oneof kind {
     Symbol stream_result = 1;
-    bool final_result = 2;
+    FinalResult result = 2;
   }
 }
 
@@ -36,7 +38,7 @@
 message FuzzyFindReply {
   oneof kind {
     Symbol stream_result = 1;
-    bool final_result = 2; // HasMore
+    FinalResult result = 2;
   }
 }
 
@@ -51,7 +53,7 @@
 message RefsReply {
   oneof kind {
     Ref stream_result = 1;
-    bool final_result = 2; // HasMore
+    FinalResult result = 2;
   }
 }
 
@@ -116,7 +118,7 @@
 message RelationsReply {
   oneof kind {
     Relation stream_result = 1;
-    bool final_result = 2; // HasMore
+    FinalResult result = 2;
   }
 }
 
Index: clang-tools-extra/clangd/index/remote/Client.cpp
===================================================================
--- clang-tools-extra/clangd/index/remote/Client.cpp
+++ clang-tools-extra/clangd/index/remote/Client.cpp
@@ -52,7 +52,7 @@
     unsigned FailedToParse = 0;
     while (Reader->Read(&Reply)) {
       if (!Reply.has_stream_result()) {
-        FinalResult = Reply.final_result();
+        FinalResult = Reply.result().has_more();
         continue;
       }
       auto Response = ProtobufMarshaller->fromProtobuf(Reply.stream_result());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89851.300528.patch
Type: text/x-patch
Size: 3150 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201025/471ebec3/attachment-0001.bin>


More information about the cfe-commits mailing list