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 @@ -2112,6 +2112,7 @@ incomingCalls(const CallHierarchyItem &Item, const SymbolIndex *Index) {
2112
2112
// FIXME: Consider also using AST information when feasible.
2113
2113
RefsRequest Request;
2114
2114
Request.IDs .insert (*ID);
2115
+ Request.WantContainer = true ;
2115
2116
// We could restrict more specifically to calls by introducing a new RefKind,
2116
2117
// but non-call references (such as address-of-function) can still be
2117
2118
// interesting as they can indicate indirect calls.
Original file line number Diff line number Diff line change @@ -72,6 +72,9 @@ struct RefsRequest {
72
72
// / choose to return less than this, e.g. it tries to avoid returning stale
73
73
// / results.
74
74
llvm::Optional<uint32_t > Limit;
75
+ // / If set, populates the container of the reference.
76
+ // / Index implementations may chose to populate containers no matter what.
77
+ bool WantContainer = false ;
75
78
};
76
79
77
80
struct RelationsRequest {
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ message RefsRequest {
47
47
repeated string ids = 1 ;
48
48
optional uint32 filter = 2 ;
49
49
optional uint32 limit = 3 ;
50
+ optional bool want_container = 4 ;
50
51
}
51
52
52
53
// The response is a stream of reference messages, and one terminating has_more
Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ Marshaller::fromProtobuf(const RefsRequest *Message) {
122
122
Req.Filter = clangd::RefKind::All;
123
123
if (Message->limit ())
124
124
Req.Limit = Message->limit ();
125
+ Req.WantContainer = Message->want_container ();
125
126
return Req;
126
127
}
127
128
@@ -239,6 +240,7 @@ RefsRequest Marshaller::toProtobuf(const clangd::RefsRequest &From) {
239
240
RPCRequest.set_filter (static_cast <uint32_t >(From.Filter ));
240
241
if (From.Limit )
241
242
RPCRequest.set_limit (*From.Limit );
243
+ RPCRequest.set_want_container (From.WantContainer );
242
244
return RPCRequest;
243
245
}
244
246
You can’t perform that action at this time.
0 commit comments