MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / render_callers

Function render_callers

atomic-cli/src/commands/query/mod.rs:1412–1441  ·  view source on GitHub ↗
(
    target: &str,
    callers: &[atomic_repository::repository::Caller],
    json: bool,
)

Source from the content-addressed store, hash-verified

1410}
1411
1412pub(crate) fn render_callers(
1413 target: &str,
1414 callers: &[atomic_repository::repository::Caller],
1415 json: bool,
1416) -> CliResult<()> {
1417 if json {
1418 println!(
1419 "{}",
1420 serde_json::to_string_pretty(callers).map_err(|e| CliError::Internal(e.into()))?
1421 );
1422 } else if callers.is_empty() {
1423 println!("No callers found for '{target}'.");
1424 } else {
1425 println!("{} caller(s) of {target}:\n", callers.len());
1426 for caller in callers {
1427 println!(
1428 " {}#{}:{}{}",
1429 caller.path,
1430 caller.name,
1431 caller.line,
1432 caller
1433 .summary
1434 .as_ref()
1435 .map(|summary| format!(" [{summary}]"))
1436 .unwrap_or_default()
1437 );
1438 }
1439 }
1440 Ok(())
1441}
1442
1443// ---------------------------------------------------------------------------
1444// QueryEntities — list tree-sitter entities in a file

Callers 2

query_callersFunction · 0.85
runMethod · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected