Skip to content
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

Feature request: Call Hierarchy #16110

Closed
svenefftinge opened this issue Nov 27, 2016 · 25 comments
Closed

Feature request: Call Hierarchy #16110

svenefftinge opened this issue Nov 27, 2016 · 25 comments
Assignees
Labels
api feature-request Request for new features or functionality on-testplan
Milestone

Comments

@svenefftinge
Copy link

A call hierarchy of a function invocation is a very useful tool to quickly navigate in code. In VSCode I find my self using "Find Reference" repeatedly to do what I do with a call hierarchy in IDEs (Eclipse, IntelliJ).

UI-wise I think it could fit nicely with how "Find References" is done, but of course we would need to have a tree on the right hand side and the labels need to display the reference containing function definitions.

Conceptually it is close to a type hierarchy, which is requested in #15533.

@hoffmael
Copy link

Adding my vote to this one. This would be my number 1 most important missing feature and use it daily in eclipse to navigate and understand the structure of a large code base. I can live without find all references feature and use global text search with whole word option instead.

@hualet
Copy link

hualet commented Jun 17, 2017

This feature is really necessary for people like me who need to browse source code of multiple open source projects.

@sandipanbiswas
Copy link

It would be super beneficial especially for users coming from eclipse,intellij background.

@jrieken
Copy link
Member

jrieken commented Jun 20, 2017

@hualet @sandipanbiswas FYI we ignore comments in the sprit of "+1", "me too", "This is needed" etc but go for up votes (:+1:) on the descriptions of this item. Please refrain from adding these comments because it generates a lot of noise to the project and we spend time reading these comments instead of getting actual coding work done. Thanks

@thernstig
Copy link
Contributor

@jrieken Have you had any progress on this?

@iradiohead
Copy link

anynews

@thernstig
Copy link
Contributor

thernstig commented Aug 9, 2018

For those in interested in this, I think we can stop asking for news on this for a while as I found this comment from 2018-08-06:
microsoft/vscode-cpptools#16 (comment)

No news. We haven't started working on this yet. We plan to implement IntelliSense-based Go to Definition and Find All References before a Call Hierarchy, all of which requires implementing a multi-translation unit IntelliSense (our currently one is only one translation unit at a time).

EDIT: as per @svenefftinge's reply, the above comment might only be related to the c/c++ extension.

@svenefftinge
Copy link
Author

@thernstig I think that comment is related to the c/c++ extension not generally to VS Code.

@bitbytemaster
Copy link

I need it desperately now - call graph or call hierarchy!

@Alex-EEE
Copy link

I agree, this is desperately needed

@svenefftinge
Copy link
Author

There now is a PR for this for the LSP
microsoft/vscode-languageserver-node#420

@med1001
Copy link

med1001 commented Nov 4, 2018

this feature will make our life easier.

@jrieken
Copy link
Member

jrieken commented Mar 10, 2019

I will explore this during the March milestone. Stay tuned.

@jrieken
Copy link
Member

jrieken commented Mar 12, 2019

UI-wise I think it could fit nicely with how "Find References" is done, but of course we would need to have a tree on the right hand side and the labels need to display the reference containing function definitions.

@svenefftinge The common UX for this seems to be a tree with a details pane on the side. Eclipse and IntelliJ are very similar, VS used to be a little different wrt calls/callers, e.g instead of the global direction toggle there could be nodes like 'Calls from "Foo"' and 'Calls to "Foo"'. That adds one more indent level for each symbol but it allows to see calls and callers at the same time. Something the Eclipse UI doesn't do:

multiplenodes

Screenshot 2019-03-12 at 11 44 42

Comments, ideas, preferences? Embedding this information as peek and/or viewlet should be doable. I was also thinking about a breadcrumb'ish approach, similar to the columns view of the Mac Finder, where a column represents all calls of a function and where expanding a call adds a new column.

@iFarmGolems
Copy link

@jrieken I think graph would be useful as well - for a quick glance when refactoring. Something like this extension has

@mharris84
Copy link

@jrieken My preference would be for the Eclipse style of call hierarchy over the VS style. The later, whilst more functional, I feel will get very noisy quickly; and in this situation I feel "less is more".

I Eclipse I am able to 'pin' a given call hierarchy such that I can have a few open at once, for me this deals with the uni-directional nature of the hierarchy.

@jrieken
Copy link
Member

jrieken commented Mar 13, 2019

My preference would be for the Eclipse style of call hierarchy over the VS style. The later, whilst more functional, I feel will get very noisy quickly; and in this situation I feel "less is more".

I was thinking along those lines but allowing all, e.g. "show calls", "show callers", "show call & callers" (vs style). Think of the radio buttons in the Eclipse UI but in a way that both can be selected at the same time.

@hoffmael
Copy link

hoffmael commented Mar 14, 2019

I was also thinking about a breadcrumb'ish approach, similar to the columns view of the Mac Finder, where a column represents all calls of a function and where expanding a call adds a new column.

Green Hills, an embedded systems compiler and IDE, implemented call hierarchy this way. In theory it sounds good, but in practice it ends up being kinda clunky because it requires so much screen real estate, as it expands in both the X and Y directions, that it needed a separate window to navigate it. I much prefer Eclipse's implementation in this regard, as it can be displayed simultaneously to the side of the code window, since it really only expands in the Y direction as call depth is increased, and you can scroll vertically to the area of interest.

See this screen shot from the Green Hills IDE, illustrating this, (the blurred parts are from scrubbing the proprietary info)
image

@jrieken
Copy link
Member

jrieken commented Mar 15, 2019

UX: The plan is to have the call hierarchy as peek and as bottom panel. I have started with peek because it simpler. Two ideas:

A Tree & Preview like it's done in Eclipse, VS, et al

callh-tree

B Columns that shows calls with the actual source lines, where selecting a call drills into it

callh-columns

@jrieken
Copy link
Member

jrieken commented Mar 18, 2019

New UX proposal that stays closes to reference search peek. Have a tree on the right, have an editor on the left. The tree shows containers, e.g. functions calling the anchor function, with a hint of how often a function calls the anchor function. The editor itself highlight them.

Screenshot 2019-03-18 at 12 15 29

This is our current favourite and this is what we will invest more in. The same/similar UI must be thought of when having the call hierarchy in the bottom panel

@jrieken
Copy link
Member

jrieken commented Mar 25, 2019

Closing as we have a UI and proposed API for this. However, this time we have been faster than extension, e.g. no extension provides data yet and will take roughly one milestone until this feature lights up. Stay tuned

Screenshot 2019-03-25 at 14 55 51

@asilvadesigns
Copy link

This is awesome.

@manas42
Copy link

manas42 commented Apr 3, 2019

Finally some hope for call hierarchy. Thank you all.

@gandhiprachi
Copy link

@zdog234 - Is this available for golang in vscode, i'm on the latest release and i'm unable to find this feature

@znd4
Copy link

znd4 commented May 1, 2019

@gandhiprachi I don't believe it's been implemented yet:
microsoft/python-language-server#888

@vscodebot vscodebot bot locked and limited conversation to collaborators May 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api feature-request Request for new features or functionality on-testplan
Projects
None yet
Development

No branches or pull requests