Skip to content

Bash Call Hierarchy

Albert Tregnaghi edited this page Aug 3, 2020 · 4 revisions

About

Bash Call Hierarchy was introduced with version V2.4.0. Initial issue was #60

Screenshot

image

Usage

Show call hierarchy

You can use

  • Context menu:

    • Editor:
      either on a function or at script level

    • Outline:
      of editor (only at function items)

    • File:
      when inside Project Explorer, Navigator etc.

  • Source menu:
    when your active editor is bash editor

  • Shortcut inside editor:
    Just press Ctrl+Shift+G inside bash editor. Either without an active selection or you select a function definition inside editor before pressing the shortcut

Open part shown in call hiararchy view

Just double click on a tree item inside Bash Call Hierarchy view and location will be opened in Bash Editor

What is searched?

  • scripts (source, exec)

  • functions (usage)

Which directions are supported?

Bottom-up : "Who calls this function/script ?"

This is supported. E.g. when selecting function "foo" inside "example1.sh" file and example2.sh is using foo inside its code, you will see example2.sh inside call hierarchy.

💡
When you see a call to a function and you want to jump to the definition, you can do this via hyperlink feature.

"Top-Down: What is function/script calling?"

At the moment this is not implemented/available.

False positives

When you are using function names inside comments or strings, those parts will also be recognized inside call hierarchy. Please be gentle and just ignore those entries/noise. Maybe in future this will be improved.

Project/Workspace level

Inside Bash Call Hierarchy View there is a blue bullet icon available. This shows that your call hierarchy search does only search inside same project. When you click on the icon it will switch to a 3 bullet variant which scans complete workspace. Clicking again to the icon switches back to project only mode.