Call Hierarchy and Type Hierarchy in Theia

I tried clicking Call Hierarchy or Type Hierarchy from view’s popup menu bar. They shows in the bottom panel ony with “No callers have been detected” or nothing.
When I right click a function in.ts file and select Call Hierarchy option, the references shows in sider bar.


When I right click a function, select Supertype Hierarchy or Subtype Hierarchy option, there’s no response.

My questions are,

  1. How to use Call Hierarchy and Type Hierarchy from view’s popup menu bar?
  2. Why the Call Hierarchy output is show in side bar but it’s view is on bottom panel?
  3. Is the Supertype Hierarchy and Subtype Hierarchy option the same function as the Type Hierarchy function? How to use it by right clicking a function’s name?

Addtional info: Tried Theia version 1.30 on both MacOS and Windows.

Any help is appreciated, thanks.

Call Hierarchy and Type Hierarchy views confuse me too :cry: Does anyone know how to use these two features?

@MistyMystery-H thank you for the discussion, and welcome to the community :+1:

  1. How to use Call Hierarchy and Type Hierarchy from view’s popup menu bar?

The Call Hierarchy and Type Hierarchy menu items you’ll find in the View menu only toggle their respective views, but will not necessarily populate them if there is nothing to display. Note that our Type Hierarchy view predates the changes in the Language Server Protocol (LSP) and newer language feature extensions may populate the References View directly thanks to the new API.

  1. Why the Call Hierarchy output is show in side bar but it’s view is on bottom panel?

They are completely different views, one is the our implementation of the Call Hierarchy, and the other is the References View plugin which contributes multiple views. There have been discussions about removing our internal extension in favor of the plugin Deprecate Call Hierarchy View and Types · Issue #10528 · eclipse-theia/theia · GitHub.

  1. Is the Supertype Hierarchy and Subtype Hierarchy option the same function as the Type Hierarchy function? How to use it by right clicking a function’s name?

The two commands should show supertype and subtype hierarchy, while type hierarchy toggles the view itself. The feature works for language-extensions which had previously used the proposed type hierarchy api, and going forward you’ll likely want to use Support vscode TypeHierarchy API (references-view) by alvsan09 · Pull Request #11694 · eclipse-theia/theia · GitHub.

2 Likes

It is important to note that the language-server (for your specific language) needs to support the protocol from the LSP to actually get callhierarchy and typehierarchy support. In the case of TypeScript, typescript-language-server does not implement typehierarchy.

1 Like

Thanks for your response. It helps me a lot. :grin: