-
Notifications
You must be signed in to change notification settings - Fork 162
Annotate references with the name of the function in which they occur #292
Comments
Can you share a screenshot? This is likely a vscode issue that cannot be fixed by cquery. |
Sure. Given this code:
when you perform "Find References" on I would like to see (In this case, you can see |
I don't think it's a VSCode issue, because the server only sends the reference's character range:
To implement this feature, the server would also need to send the name of the enclosing function for each reference. |
What is needed to be done on cquery's side:
|
Why can't we just add the information to TextDocumentPositionParams (or some derived type that the references message uses)? This approach eliminates the need for subclass serialization. |
|
this requires more info in // 12 bytes
struct QueryLocation {
QueryFileId path; // 4 bytes
Range range; // 8 bytes
};
struct QueryVar {
...
std::vector<QueryLocation> uses;
}; We should think how to encode the parent symbol information without bloating the size too much. struct IndexVar {
...
std::vector<Range> uses;
}; |
It looks like the necessary information is available from libclang via |
For a symbol occurrence (
|
I filed an LSP spec issue for this: microsoft/language-server-protocol#396. |
Renamed 360a4ca added Maybe<typename F::Range> definition_spelling;
Maybe<typename F::Range> definition_extent; to |
The uses of Query{Func,Type,Var} have been unified to struct IndexFunc {
...
std::vector<Use> uses;
};
|
When performing Find References, it would be really useful if each reference was annotated with the name of the functin in which the reference occurs (in addition to the name of the file, which is already there).
The text was updated successfully, but these errors were encountered: