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

Function render_callers

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

Source from the content-addressed store, hash-verified

1420}
1421
1422pub(crate) fn render_callers(
1423 target: &str,
1424 callers: &[atomic_repository::repository::Caller],
1425 json: bool,
1426) -> CliResult<()> {
1427 if json {
1428 println!(
1429 "{}",
1430 serde_json::to_string_pretty(callers).map_err(|e| CliError::Internal(e.into()))?
1431 );
1432 } else if callers.is_empty() {
1433 println!("No callers found for '{target}'.");
1434 } else {
1435 println!("{} caller(s) of {target}:\n", callers.len());
1436 for caller in callers {
1437 println!(
1438 " {}#{}:{}{}",
1439 caller.path,
1440 caller.name,
1441 caller.line,
1442 caller
1443 .summary
1444 .as_ref()
1445 .map(|summary| format!(" [{summary}]"))
1446 .unwrap_or_default()
1447 );
1448 }
1449 }
1450 Ok(())
1451}
1452
1453// ---------------------------------------------------------------------------
1454// 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