call_hierarchy
Display incoming and outgoing calls for a symbol to trace control flow and assess change impact. Accepts a symbol name or file position, with topology fallback when language server lacks data.
Instructions
Show the call hierarchy for a symbol: who calls it (incoming) and what it calls (outgoing). PREFER a name (uri + symbol_name) — plumb resolves the exact identifier position for you, avoiding off-by-one errors; a raw file position (uri + line + character) is the fallback and, when it lands off an identifier, is snapped to the enclosing symbol. Useful for understanding control flow and assessing the impact of changes. When the language server provides no call hierarchy for the file (e.g. zls for Zig), falls back to the topology call graph, annotated source=topology (approximate).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uri | No | Absolute path, file:// URI, or workspace-relative path containing the symbol | |
| line | No | Zero-based line number of the symbol. Required when symbol_name is not provided. | |
| character | No | Zero-based character offset within the line. Required when symbol_name is not provided. | |
| direction | No | Which call direction to return: callers (incoming), callees (outgoing), or both. Defaults to both. | |
| symbol_name | No | Symbol name to look up instead of a position — PREFERRED over line/character. Accepts plain name or ReceiverType.MethodName form. plumb resolves it against the file's symbols, avoiding the off-by-one and 'no identifier found' errors of a hand-computed position. When provided, line and character are not needed. |