File tree Expand file tree Collapse file tree 4 files changed +7
-0
lines changed Expand file tree Collapse file tree 4 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -319,6 +319,7 @@ template <> struct MappingTraits<Ref> {
319319 MappingNormalization<NormalizedRefKind, RefKind> NKind (IO, R.Kind );
320320 IO.mapRequired (" Kind" , NKind->Kind );
321321 IO.mapRequired (" Location" , R.Location );
322+ IO.mapOptional (" Container" , R.Container );
322323 }
323324};
324325
Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ message Symbol {
8181message Ref {
8282 optional SymbolLocation location = 1 ;
8383 optional uint32 kind = 2 ;
84+ optional string container = 3 ;
8485}
8586
8687message SymbolInfo {
Original file line number Diff line number Diff line change @@ -203,6 +203,9 @@ llvm::Expected<clangd::Ref> Marshaller::fromProtobuf(const Ref &Message) {
203203 return Location.takeError ();
204204 Result.Location = *Location;
205205 Result.Kind = static_cast <RefKind>(Message.kind ());
206+ auto ContainerID = SymbolID::fromStr (Message.container ());
207+ if (ContainerID)
208+ Result.Container = *ContainerID;
206209 return Result;
207210}
208211
@@ -340,6 +343,7 @@ llvm::Expected<Ref> Marshaller::toProtobuf(const clangd::Ref &From) {
340343 if (!Location)
341344 return Location.takeError ();
342345 *Result.mutable_location () = *Location;
346+ Result.set_container (From.Container .str ());
343347 return Result;
344348}
345349
Original file line number Diff line number Diff line change @@ -223,6 +223,7 @@ TEST(RemoteMarshallingTest, RefSerialization) {
223223 Location.FileURI = testPathURI (
224224 " llvm-project/llvm/clang-tools-extra/clangd/Protocol.h" , Strings);
225225 Ref.Location = Location;
226+ Ref.Container = llvm::cantFail (SymbolID::fromStr (" 0000000000000001" ));
226227
227228 Marshaller ProtobufMarshaller (testPath (" llvm-project/" ),
228229 testPath (" llvm-project/" ));
You can’t perform that action at this time.
0 commit comments