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 install_hook
travsr refs install_hook # visible alias
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: fn:install_hook (function) — crates/travsr-daemon/src/hook.rs:185
13 reference(s):
crates/travsr-daemon/src/hook.rs:527
crates/travsr-daemon/src/hook.rs:542
crates/travsr-daemon/src/hook.rs:556
...
(Trimmed after three references.)
Options
| Flag | Meaning |
|---|---|
--path <PATH> | File-path hint, to disambiguate an overloaded name |
--format <text|json> | Defaults to text. json emits a structured object for scripting: symbol, resolved_to (signature, kind, path, line), references[] (path, line), plus path, status, candidates, total, truncated and note |
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) — fixtures/lang-sanity/cpp/widget.h:11
method:Widget.area (method) — fixtures/lang-sanity/cpp/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 recorded no reference
occurrences for this language in this repo; the result below is not a definitive
zero. Run `travsr status` to check progress, or use `find_pattern` for a textual
search.
Check travsr status or travsr lang list when you see that.
The MCP equivalent is find_references.