[clang-tools-extra] e6c1c3f - [clang] Split remote index service definition into a separate file.
Sam McCall via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 23 06:21:43 PDT 2020
Author: Sam McCall
Date: 2020-10-23T15:20:51+02:00
New Revision: e6c1c3f97f13b7d973fa786a3f2da883fa31bdf6
URL: https://github.com/llvm/llvm-project/commit/e6c1c3f97f13b7d973fa786a3f2da883fa31bdf6
DIFF: https://github.com/llvm/llvm-project/commit/e6c1c3f97f13b7d973fa786a3f2da883fa31bdf6.diff
LOG: [clang] Split remote index service definition into a separate file.
This allows it to have a separate namespace (grpc versioned service) without
putting versioning info on all of the other protos (before we need it).
clang-index-server is still broken (from 81e5f298c431555).
Differential Revision: https://reviews.llvm.org/D90031
Added:
clang-tools-extra/clangd/index/remote/Service.proto
Modified:
clang-tools-extra/clangd/index/remote/CMakeLists.txt
clang-tools-extra/clangd/index/remote/Client.cpp
clang-tools-extra/clangd/index/remote/Index.proto
clang-tools-extra/clangd/index/remote/marshalling/CMakeLists.txt
clang-tools-extra/clangd/index/remote/server/CMakeLists.txt
clang-tools-extra/clangd/index/remote/server/Server.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/index/remote/CMakeLists.txt b/clang-tools-extra/clangd/index/remote/CMakeLists.txt
index 8bd5db543921..94f5699b42d6 100644
--- a/clang-tools-extra/clangd/index/remote/CMakeLists.txt
+++ b/clang-tools-extra/clangd/index/remote/CMakeLists.txt
@@ -1,5 +1,6 @@
if (CLANGD_ENABLE_REMOTE)
- generate_protos(RemoteIndexProtos "Index.proto" GRPC)
+ generate_protos(RemoteIndexServiceProto "Service.proto" GRPC)
+ generate_protos(RemoteIndexProto "Index.proto")
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../)
@@ -12,7 +13,8 @@ if (CLANGD_ENABLE_REMOTE)
Client.cpp
LINK_LIBS
- RemoteIndexProtos
+ RemoteIndexProto
+ RemoteIndexServiceProto
clangdRemoteMarshalling
protobuf
@@ -21,7 +23,8 @@ if (CLANGD_ENABLE_REMOTE)
clangdSupport
DEPENDS
- RemoteIndexProtos
+ RemoteIndexProto
+ RemoteIndexServiceProto
)
add_subdirectory(marshalling)
diff --git a/clang-tools-extra/clangd/index/remote/Client.cpp b/clang-tools-extra/clangd/index/remote/Client.cpp
index d01dd4483974..a134d9c72932 100644
--- a/clang-tools-extra/clangd/index/remote/Client.cpp
+++ b/clang-tools-extra/clangd/index/remote/Client.cpp
@@ -9,7 +9,7 @@
#include <grpc++/grpc++.h>
#include "Client.h"
-#include "Index.grpc.pb.h"
+#include "Service.grpc.pb.h"
#include "index/Index.h"
#include "index/Serialization.h"
#include "marshalling/Marshalling.h"
diff --git a/clang-tools-extra/clangd/index/remote/Index.proto b/clang-tools-extra/clangd/index/remote/Index.proto
index a9ebc75ebc88..654d1eb750f0 100644
--- a/clang-tools-extra/clangd/index/remote/Index.proto
+++ b/clang-tools-extra/clangd/index/remote/Index.proto
@@ -10,19 +10,6 @@ syntax = "proto2";
package clang.clangd.remote.v1;
-// Semantics of SymbolIndex match clangd::SymbolIndex with all required
-// structures corresponding to their clangd::* counterparts.
-// NOTE: Enum values are offset by one to detect missing values.
-service SymbolIndex {
- rpc Lookup(LookupRequest) returns (stream LookupReply) {}
-
- rpc FuzzyFind(FuzzyFindRequest) returns (stream FuzzyFindReply) {}
-
- rpc Refs(RefsRequest) returns (stream RefsReply) {}
-
- rpc Relations(RelationsRequest) returns (stream RelationsReply) {}
-}
-
message LookupRequest { repeated string ids = 1; }
// The response is a stream of symbol messages and the terminating message
diff --git a/clang-tools-extra/clangd/index/remote/Service.proto b/clang-tools-extra/clangd/index/remote/Service.proto
new file mode 100644
index 000000000000..4e39ff9ec666
--- /dev/null
+++ b/clang-tools-extra/clangd/index/remote/Service.proto
@@ -0,0 +1,26 @@
+//===--- Service.proto - Remote index service definition ------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+syntax = "proto2";
+
+package clang.clangd.remote.v1;
+
+import "Index.proto";
+
+// Semantics of SymbolIndex match clangd::SymbolIndex with all required
+// structures corresponding to their clangd::* counterparts.
+service SymbolIndex {
+ rpc Lookup(LookupRequest) returns (stream LookupReply) {}
+
+ rpc FuzzyFind(FuzzyFindRequest) returns (stream FuzzyFindReply) {}
+
+ rpc Refs(RefsRequest) returns (stream RefsReply) {}
+
+ rpc Relations(RelationsRequest) returns (stream RelationsReply) {}
+}
+
diff --git a/clang-tools-extra/clangd/index/remote/marshalling/CMakeLists.txt b/clang-tools-extra/clangd/index/remote/marshalling/CMakeLists.txt
index 75e57edd45d9..7b78ba3bb690 100644
--- a/clang-tools-extra/clangd/index/remote/marshalling/CMakeLists.txt
+++ b/clang-tools-extra/clangd/index/remote/marshalling/CMakeLists.txt
@@ -2,12 +2,12 @@ add_clang_library(clangdRemoteMarshalling
Marshalling.cpp
LINK_LIBS
- RemoteIndexProtos
+ RemoteIndexProto
protobuf
clangDaemon
clangdSupport
DEPENDS
- RemoteIndexProtos
+ RemoteIndexProto
)
diff --git a/clang-tools-extra/clangd/index/remote/server/CMakeLists.txt b/clang-tools-extra/clangd/index/remote/server/CMakeLists.txt
index 9ca1f3473087..595c406eff0f 100644
--- a/clang-tools-extra/clangd/index/remote/server/CMakeLists.txt
+++ b/clang-tools-extra/clangd/index/remote/server/CMakeLists.txt
@@ -5,7 +5,8 @@ add_clang_executable(clangd-index-server
Server.cpp
DEPENDS
- RemoteIndexProtos
+ RemoteIndexProto
+ RemoteIndexServiceProto
)
target_link_libraries(clangd-index-server
@@ -13,7 +14,8 @@ target_link_libraries(clangd-index-server
clangDaemon
clangdSupport
- RemoteIndexProtos
+ RemoteIndexProto
+ RemoteIndexServiceProto
clangdRemoteMarshalling
grpc++
diff --git a/clang-tools-extra/clangd/index/remote/server/Server.cpp b/clang-tools-extra/clangd/index/remote/server/Server.cpp
index d8cf54249662..df8ef2ba2f47 100644
--- a/clang-tools-extra/clangd/index/remote/server/Server.cpp
+++ b/clang-tools-extra/clangd/index/remote/server/Server.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "Index.pb.h"
+#include "Service.grpc.pb.h"
#include "index/Index.h"
#include "index/Serialization.h"
#include "index/Symbol.h"
More information about the cfe-commits
mailing list