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

Call hierarchy #16

Closed
csholmq opened this issue Apr 17, 2016 · 207 comments
Closed

Call hierarchy #16

csholmq opened this issue Apr 17, 2016 · 207 comments
Labels
Feature: Call Hierarchy Feature Request fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Milestone

Comments

@csholmq
Copy link
Contributor

csholmq commented Apr 17, 2016

Perhaps the inverse to #15; to be able to view an entire call hierarchy of a function.

Seen it implemented in Eclipse.

@DanielGibson
Copy link

Having this feature would be awesome!
In Eclipse it also works for class fields, enum constants and global variables (showing functions they're used in, and expanding the function call hierarchy from there). To be better than Eclipse, making it work for macros as well would be extra cool :)

It's really invaluable to understand and navigate non-small code bases.

@sean-mcmanus
Copy link
Contributor

Visual Studio has this, but VS Code doesn't currently have any interface to enable a call hierarchy (other than possibly some unusual interface involving repeated dropdown popups). Maybe someone could file a feature request with VS Code to enable this, if it's not already been requested? This would require the IntelliSense engine from our end. It's not on our radar to implement this yet though (Find All References would be higher priority).

@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.

@sean-mcmanus
Copy link
Contributor

See microsoft/vscode#16110 .

@gulshan
Copy link

gulshan commented Jun 15, 2017

A new tree view api has been added to vscode. So, this should be doable now.

@sean-mcmanus
Copy link
Contributor

@hoffmael
Copy link

Can I vote twice for this one? The well implemented call hierarchy is the main reason eclipse is still my go-to IDE as its an invaluable tool to navigate 1M+ LOC code bases.

@sandipanbiswas
Copy link

Awesome feature to have! Right there on the top of bucket list..

@jguiban
Copy link

jguiban commented Feb 13, 2018

+1 for having this useful feature integrated soon

@KarolisMil
Copy link

I would also appreciate this feature. Highly used feature... I finally could switch from eclipse to Visual code.

@sean-mcmanus
Copy link
Contributor

@KarolisMil Yes, this is our second most up-voted feature request (behind find all references). Survey feedback indicates that too many users are having trouble getting IntelliSense setup so we're working on improving that first.

@aisnote
Copy link

aisnote commented Jun 19, 2018

I need the Call hierarchy too!

@iradiohead
Copy link

anynews

@sean-mcmanus
Copy link
Contributor

@iradiohead 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).

@snanurag
Copy link

snanurag commented Sep 7, 2018

waiting for this feature. Daily waste like an hour because of absence of this feature!!

@dbsquared
Copy link

please implement this. hard to be an IDE without searching the callers.

@lunxian
Copy link

lunxian commented Jan 20, 2019

need this feature. I think it's useful for large project.

@ggruber4711
Copy link

+1 for this feature
Coming from eclipse, this is a MUST HAVE

@defcod
Copy link

defcod commented Feb 28, 2019

Any updates?

@bobbrow
Copy link
Member

bobbrow commented Feb 28, 2019

This is now third on the feature backlog. I don't have a date for you yet though.

@sdebnath
Copy link

Great news! I am hoping its going to be similar to Eclipse's call hierarchy where a button lets you select if it's caller or callee [1] (though I rarely look up callees). Unlike [2]. However, like [2] would be great if we could have a code definition window where a preview is displayed for the selected item. This helps avoid context switching in the main editor.

[1] https://help.eclipse.org/mars/topic/org.eclipse.cdt.doc.user/images/view_call_hierarchy.png
[2] https://docs.microsoft.com/en-us/visualstudio/ide/reference/call-hierarchy?view=vs-2017,

@kabukunz
Copy link

kabukunz commented Mar 15, 2019

Like Eclipse, XCode, PyCharm, whatever... this is absolutely needed in any serious professional programming environment
Just find myself to switch back to XCode on my mac right now because I need to see a big project call tree... sigh...

@michelleangela
Copy link
Contributor

Just used the call hierachy feature it works great, however I have a question to vscode team related to performance, in eclipse I believe once all files are indexed the call hierachy is pretty fast, but in vscode it looks like the result isn't cached which results in scanning the files again even when there is no code change, any way we could support auto indexing and cache the result?

@cdong8812 I created the new issue #10996 for this feature request.

@michelleangela
Copy link
Contributor

michelleangela commented May 23, 2023

@csholmq

Worked great when I used it before 👌 Only one detail on my wishlist which is to easily view which file the call resides in without clicking.

I've created the new issue #10997 for this request.

A question though. Are ignored files excluded from the results? I saw some results I wasn't expecting but didn't have time to look into it.

It should follow the file exclude settings, also ensure C_Cpp.exclusionPolicy is set based on which file exclude setting (files.exclude or C_Cpp.files.exclude) is used. If the file exclude setting is not working, please create a new issue for a file exclude bug.

@talabir
Copy link

talabir commented May 24, 2023

Are there plans to support call hierarchy for variables/class members?

@RaveGun
Copy link

RaveGun commented May 24, 2023

I just tested this on an Autosar project.
There is just a limited number of returned results.
It looks like is just analyzing the local file.

The issue I have with my VSCode installation is that it looks funny.
All the buttons are doubled:
image

And also the context menu shows the option twice.
image

I am just using the zip installation version of VSCode.

@michelleangela
Copy link
Contributor

@RaveGun
I created a new issue for your post at #11002

@michelleangela
Copy link
Contributor

Are there plans to support call hierarchy for variables/class members?

@talabir
Could you provide an example or clarify the behavior of "call hierarchy for variables/class members"? We have the feature "Find All References" that shows where a symbol is referenced or called. Is this what you mean?

@kubsztal
Copy link

@michelleangela
Check how Source Insight implements this feature and make it a bit better (if possible at all). No one will need more.

@RaveGun
Copy link

RaveGun commented May 25, 2023

Does the extension detects calls to functions that are part of a function pointer array?

@talabir
Copy link

talabir commented May 28, 2023

michelleangela
Sure,
Just as in eclipse, you can see in the call hierarchy the function that reference this member and their call hierarchy...
It's really useful

@michelleangela
Copy link
Contributor

michelleangela Sure, Just as in eclipse, you can see in the call hierarchy the function that reference this member and their call hierarchy... It's really useful

@talabir
Is this the Eclipse call hierarchy you're referring to on Eclipse's editor for C++? Could you point to where it refers to variables? It looks like the Eclipse call hierarchy UI call tree is similar to how VS Code provides a tree of callers or callees (as you expand a function node, it will show any callers or callees of that function).

@j4yk
Copy link

j4yk commented May 30, 2023

@michelleangela
In the Eclipse Java Development Tools one can invoke the call hierarchy feature on the member variables of classes. It will show the selected variable as the root of the tree, with the methods that assign to or read from this variable as children nodes, and one can navigate to the further callers of these methods within the same tree. (The "Callee" Hierarchy for a variable has no other nodes besides the root node for the variable, naturally.)

In the Eclipse C/C++ Development Tools, call hierarchy has only worked on actual functions for me, not for global variables in the C code (maybe that has changed in more recent versions, or maybe it would work on C++ class members, I don't know). Instead, I always need to use the Search for References feature on variables, which is similar to the Go to References command in VS code. To go further with the callers, I would have to separately invoke the call hierarchy on the functions in which the references were found. That is somewhat less convenient than in Java and may require more than just one call hierarchy invocation, generating a new tree each time.

Great to hear that the call hierarchy feature comes to VS Code for C/C++! Thank you for making it happen!

@michelleangela
Copy link
Contributor

@j4yk
Thank you for the clarification on how a call hierarchy works on member variables of classes for Java development in Eclipse.

Unlike Java or C# though, there's no call hierarchy on variables for C++, only on functions or class methods. The closest thing would be doing a reference search on a symbol (e.g. variable) and see which reference is a function that uses the symbol.

@talabir
Copy link

talabir commented May 31, 2023

@michelleangela are there plans to add support for call hierarchy for members and normal variables?
Is it hard or a low hanging fruit?

@michelleangela
Copy link
Contributor

@michelleangela are there plans to add support for call hierarchy for members and normal variables? Is it hard or a low hanging fruit?

@talabir
There's no call hierarchy on variables for C++, only on functions or class methods. As this is not a thing for C++ there are no plans for this. The closest thing would be doing a reference search on a symbol (e.g. variable) and see which reference is a function that uses the symbol.

@talabir
Copy link

talabir commented May 31, 2023

@michelleangela is it possible to add a feature request for it?
It's really useful...

@michelleangela
Copy link
Contributor

@michelleangela is it possible to add a feature request for it? It's really useful...

Sure, if you'd like, you're welcome to create a new issue for a feature request.

@talabir
Copy link

talabir commented Jun 1, 2023

@michelleangela
#11037

Thank you,
Tal.

@chrislro2019
Copy link

chrislro2019 commented Jun 5, 2023

Great to see this long awaited feature is implemented 👍

I installed the pre-release version. Works so far as expected, but I cannot assign a keyboard shortcut to "Peek Call Hierarchy" (I like more the "inline" view like all the other "Peek"). Is this missing just in this pre-release or might this be another request?

EDIT: I found finally this older vscode issue microsoft/vscode#113184 (comment) - summary: against my expectation "peek" is not the term used in Keyboard Shortcuts. Then irritatingly by default SHIFT+ALT+H is also used by references-view.showCallHierarchy to show the hierarchy in the side bare. When assigning a different, non-default shortcut to editor.showCallHierarchy (or changing it for references-view.showCallHierarchy), then the "peek" UI is used.

@sean-mcmanus
Copy link
Contributor

@chrislro2019 You should file a VS Code bug at https://github.com/microsoft/vscode/issues .

@michelleangela
Copy link
Contributor

michelleangela commented Jun 5, 2023

🎗️ Reminder about creating issues for call hierarchy 🎗️

For Data Processing or Data Result
For new feature requests or new issues concerning data processing or data result of call hierarchy, please create a new issue for the C++ extension.

For User Interface
For concerns about the user interface (such as the references panel view, commands, shortcuts, etc.) of call hierarchy please create a new issue at the VS Code repository as the VS Code client implements the API provider. The C++ extension only provides the data.

@michelleangela
Copy link
Contributor

Call hierarchy is now available in release version 1.16.2.

@michelleangela michelleangela removed their assignment Jun 23, 2023
@VictorChun
Copy link

@michelleangela many thanks!!!

@agosdahu
Copy link

Much awaited!
Cheers!

@csholmq
Copy link
Contributor Author

csholmq commented Jun 23, 2023

💥

@github-actions github-actions bot locked and limited conversation to collaborators Aug 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature: Call Hierarchy Feature Request fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
None yet
Development

No branches or pull requests