travsr references
Enumerate every use site of a symbol as path:line, including inline expressions, assignments, and type references, not only calls.
The broader sibling of travsr graph's caller view. Use graph to ask what would break if a function's behaviour changed; use references before a rename, where a type annotation or a re-export is what bites.
travsr references PaymentService
The blocks below reproduce the command's real output verbatim, including its punctuation, so they can be compared against what you see in a terminal.
resolved: class:PaymentService (class) — src/billing/payment.ts:14
3 reference(s):
src/api/checkout.ts:22
src/billing/refund.ts:8
src/types/index.ts:41
Options
| Flag | Meaning |
|---|---|
--path <PATH> | File-path hint, to disambiguate an overloaded name |
--format <text|json> | json emits { "symbol", "path", "output" } for scripting |
Ambiguity is reported, not guessed
A bare name defined in more than one place returns the candidates instead of picking one:
'area' is ambiguous — 2 definitions. Re-run with a `path` hint to pick one:
method:Shape.area (method) — widget.h:11
method:Widget.area (method) — widget.h:20
Pass --path, or the full signature (method:Widget.area) as the symbol.
For the same reason, a bare call to a name defined in several files may be left unindexed rather than attributed to a guess. An empty result for an ambiguous name is a refusal to mis-target, not a claim that nothing uses it.
When results look thin
Reference fidelity comes from Phase B. If a language has no analyzer installed, its use sites were never recorded, and the tool says so rather than returning a confident zero:
Occurrence index unavailable for 'c': semantic analysis (Phase B) recorded no
reference occurrences for this language in this repo — the result below is not
a definitive zero.
Check travsr status or travsr lang list when you see that.
The MCP equivalent is find_references.