Skip to Content

who-calls

List the symbols that directly call a given symbol — its immediate callers.

Source: src/commands/who_calls_command.ts · query: GraphQuery.whoCalls in src/query/graph_query.ts

Synopsis

npx codespine who-calls <id> [options]

Arguments

ArgumentRequiredDescription
<id>yesNode id of the symbol to inspect (a function or method). Obtain it from find --json.

Options

OptionDefaultDescription
-o, --output-folder <dir>./.codespineOutput folder; the Kùzu database is read from <dir>/graph.kuzu.
--jsonfalseEmit raw JSON instead of the formatted table.

What it does

Follows CALLS edges inbound to the target, one hop:

MATCH (caller:GraphNode)-[e:Edge]->(callee:GraphNode {id: $id}) WHERE e.kind = 'CALLS' RETURN caller.id, caller.kind, caller.name, caller.filePath, caller.startLine ORDER BY filePath, startLine

It returns the direct callers only — symbols that contain a call site targeting <id>. It does not follow the chain further; for the full transitive set of impacted symbols, use blast-radius.

CALLS edges only exist when the graph was extracted with --semantic.

Output

Formatted (default) — one line per caller:

Method run src/store/kuzu_store.ts:49 Function main src/cli.ts:16 2 result(s)

JSON (--json) — an array of SymbolRef objects (id, kind, name, filePath, startLine). No callers yields (no results) / [].

Examples

# who calls KuzuStore.run, directly? npx codespine who-calls 'MethodDeclaration:src/store/kuzu_store.ts#run@49' # machine-readable, for scripting npx codespine who-calls 'MethodDeclaration:src/store/kuzu_store.ts#run@49' --json
QuestionCommand
Who calls this, directly (one hop)?who-calls
What does this call, directly?calls
Who is transitively affected if I change this?blast-radius
Everything that references this (not just calls)?references

Notes and caveats

  • Empty results can mean the symbol genuinely has no callers, or that the id is stale — re-run find to confirm the id is current.
  • Only static call sites are captured. Calls made through dynamic dispatch or reflection do not appear.

See also

Last updated on