Summary
references, callers, and callees return symbol locations but no flag to include the matching symbol body inline. A consumer that wants to read the bodies must follow up with one excerpt (or find_in_file) per result, which is N+1 calls and significantly slower over MCP.
Where
src/CodeIndex/Cli/QueryCommandRunner.cs:177 (references)
src/CodeIndex/Cli/QueryCommandRunner.cs:321 (callers)
src/CodeIndex/Cli/QueryCommandRunner.cs:441 (callees)
src/CodeIndex/Cli/QueryCommandRunner.cs:563 (impact)
Why it matters
LLM-driven workflows almost always need the body next to the location. Asking for "all callers of X and what each one looks like" should be one round-trip, not 1+N. The same change benefits CLI users piping into less for review.
Suggested approach
Add --body (default off, opt-in) and --snippet-lines N to each of the four commands. Reuse the snippet formatter that search already uses. Apply a per-call output cap so very large fan-outs do not blow up.
Summary
references,callers, andcalleesreturn symbol locations but no flag to include the matching symbol body inline. A consumer that wants to read the bodies must follow up with oneexcerpt(orfind_in_file) per result, which is N+1 calls and significantly slower over MCP.Where
src/CodeIndex/Cli/QueryCommandRunner.cs:177(references)src/CodeIndex/Cli/QueryCommandRunner.cs:321(callers)src/CodeIndex/Cli/QueryCommandRunner.cs:441(callees)src/CodeIndex/Cli/QueryCommandRunner.cs:563(impact)Why it matters
LLM-driven workflows almost always need the body next to the location. Asking for "all callers of X and what each one looks like" should be one round-trip, not 1+N. The same change benefits CLI users piping into
lessfor review.Suggested approach
Add
--body(default off, opt-in) and--snippet-lines Nto each of the four commands. Reuse the snippet formatter thatsearchalready uses. Apply a per-call output cap so very large fan-outs do not blow up.