SluggishNewb
SluggishNewb

Reputation: 75

Can't find 'Show Call Hierarchy' in VSCode

When I right click a function, there's no 'Show Call Hierarchy' or 'Peek Call Hierarchy' option whatsoever. My popup menu looks like this

enter image description here

Then I tried Typing 'Show All Hierarchy' in command palette. This command does exist, but only gives a 'No Result' window after hitting enter.

So I went to Keyboard Shortcuts page, and it looks like this enter image description here

My questions are,

  1. Why can't I find 'Call Hierarchy' in popup menu while every tutorial online claims that I should have found it at this point.
  2. What does 'When' field in Keyboard Shortcut page mean? Am I missing any 'CallHierarchyProvider'?

Addtional info: VSCode version 1.60, having C/C++ and Emacs Keymap extensions installed. Tried VSCode on both MacOS and Ubuntu, issue remains the same. The code base I'm currently viewing is configured with CMake.

Any help is appreciated, thanks.

Upvotes: 4

Views: 11395

Answers (2)

Aviv
Aviv

Reputation: 424

For me, clangd vscode extension grants that capability and it seems integrated well enough to replace the basic intellisense. You will need to disable the default intellisense for that feature.

enter image description here

But as was mentioned here in the comments, "Show Hierarchy" support is listed in their backlog and expected to work with deafult c++ intellisense in the future.

It may be annoying to work with clangd while compiling with a gcc - some warnings and errors are not actually synced. This is very obvious with c++2a features support

Upvotes: 1

Lex Li
Lex Li

Reputation: 63183

When a feature like that is added to VSCode release notes or any other documentation, you should assume that it is initially only available for JavaScript/TypeScript,

Visual Studio Code show call hierarchy

That's very commmon because VSCode is just an editor providing the infrastructure (context menus and other visual elements), but the actual language feature is provided by the individual language extensions and their language servers.

In your case, the C++ extension and its language server might fall far behind to support such features.

Upvotes: 4

Related Questions