-
Notifications
You must be signed in to change notification settings - Fork 33.3k
"Show Call Hierarchy" should show all references for multiple calls in the same function #169989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
vscode.provideIncomingCalls returns fromRanges[] for each element in CallHierarchyIncomingCall[] but only fromRanges[0] is displayed. Create new CallItems for fromRanges[1] to fromRanges[fromRanges.length-1].
@microsoft-github-policy-service agree
|
I would appreciate it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's important feature for trace code, please help to review this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi @jrieken, kindly inform me if I overlooked any procedures or steps, ensuring the review process doesn't encounter any disruptions. Thank you. |
looks like this could be moved forward? |
Is this still relevant? |
I think so. I came here looking for a solution to the exact problem. It has been nagging me for a while. |
I'm also interested, especially on the possibility to see the file names, which is an improvement I've been looking for, for a very long time. P.S. — In my case, it's for Python (in case it's important). EDIT: If we're crazy, it could even be interesting to show the Class if it's a class method. |
When you trigger "Show Call Hierarchy" to see incoming calls, vscode/references-view only shows one reference (the first one) if multiple calls in the same function.
For example:
Here is simple code to illustrate how references-view displayed.
Bar2()
callsFoo()
at line 8 and 9 but only one reference visible in view. Although we can jump to the first call location whereFoo()
is invoked after including Fix 168307, we have no way of knowing that there are other locations whereFoo()
is also called in the same functionBar2()
in view.According to LSP definition of call hierarchy incoming calls, it shall use fromRanges properly by creating a single item for every reference.
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#callHierarchy_incomingCalls
Proposed Result
All but the first one are not collapsible because the call hierarchy is the same as the first one if a single callee contains multiple references. To distinguish each item and improve user-friendliness, file name and calling line are added in description of the item.
Environment