File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ message Relation {
133
133
}
134
134
135
135
message ContainedRefsRequest {
136
- required string id = 1 ;
136
+ optional string id = 1 ;
137
137
optional uint32 limit = 2 ;
138
138
}
139
139
@@ -145,7 +145,7 @@ message ContainedRefsReply {
145
145
}
146
146
147
147
message ContainedRef {
148
- required SymbolLocation location = 1 ;
149
- required uint32 kind = 2 ;
150
- required string symbol = 3 ;
148
+ optional SymbolLocation location = 1 ;
149
+ optional uint32 kind = 2 ;
150
+ optional string symbol = 3 ;
151
151
}
Original file line number Diff line number Diff line change @@ -129,6 +129,8 @@ Marshaller::fromProtobuf(const RefsRequest *Message) {
129
129
llvm::Expected<clangd::ContainedRefsRequest>
130
130
Marshaller::fromProtobuf (const ContainedRefsRequest *Message) {
131
131
clangd::ContainedRefsRequest Req;
132
+ if (!Message->has_id ())
133
+ return error (" ContainedRefsRequest requires an id." );
132
134
auto ID = SymbolID::fromStr (Message->id ());
133
135
if (!ID)
134
136
return ID.takeError ();
@@ -207,6 +209,12 @@ llvm::Expected<clangd::Ref> Marshaller::fromProtobuf(const Ref &Message) {
207
209
llvm::Expected<clangd::ContainedRefsResult>
208
210
Marshaller::fromProtobuf (const ContainedRef &Message) {
209
211
clangd::ContainedRefsResult Result;
212
+ if (!Message.has_location ())
213
+ return error (" ContainedRef must have a location." );
214
+ if (!Message.has_kind ())
215
+ return error (" ContainedRef must have a kind." );
216
+ if (!Message.has_symbol ())
217
+ return error (" ContainedRef must have a symbol." );
210
218
auto Location = fromProtobuf (Message.location ());
211
219
if (!Location)
212
220
return Location.takeError ();
You can’t perform that action at this time.
0 commit comments