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> {
319
319
MappingNormalization<NormalizedRefKind, RefKind> NKind (IO, R.Kind );
320
320
IO.mapRequired (" Kind" , NKind->Kind );
321
321
IO.mapRequired (" Location" , R.Location );
322
+ IO.mapOptional (" Container" , R.Container );
322
323
}
323
324
};
324
325
Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ message Symbol {
81
81
message Ref {
82
82
optional SymbolLocation location = 1 ;
83
83
optional uint32 kind = 2 ;
84
+ optional string container = 3 ;
84
85
}
85
86
86
87
message SymbolInfo {
Original file line number Diff line number Diff line change @@ -189,6 +189,9 @@ llvm::Expected<clangd::Ref> Marshaller::fromProtobuf(const Ref &Message) {
189
189
return Location.takeError ();
190
190
Result.Location = *Location;
191
191
Result.Kind = static_cast <RefKind>(Message.kind ());
192
+ auto ContainerID = SymbolID::fromStr (Message.container ());
193
+ if (ContainerID)
194
+ Result.Container = *ContainerID;
192
195
return Result;
193
196
}
194
197
@@ -296,6 +299,7 @@ llvm::Expected<Ref> Marshaller::toProtobuf(const clangd::Ref &From) {
296
299
if (!Location)
297
300
return Location.takeError ();
298
301
*Result.mutable_location () = *Location;
302
+ Result.set_container (From.Container .str ());
299
303
return Result;
300
304
}
301
305
Original file line number Diff line number Diff line change @@ -223,6 +223,7 @@ TEST(RemoteMarshallingTest, RefSerialization) {
223
223
Location.FileURI = testPathURI (
224
224
" llvm-project/llvm/clang-tools-extra/clangd/Protocol.h" , Strings);
225
225
Ref.Location = Location;
226
+ Ref.Container = llvm::cantFail (SymbolID::fromStr (" 0000000000000001" ));
226
227
227
228
Marshaller ProtobufMarshaller (testPath (" llvm-project/" ),
228
229
testPath (" llvm-project/" ));
You can’t perform that action at this time.
0 commit comments