use anyhow::Result;
use clap::Args;
use std::path::Path;
use super::refs::{run_callers_transitive, CallersArgs};
#[derive(Args, Debug)]
pub struct ImpactArgs {
pub symbol: String,
#[arg(long, default_value = "3")]
pub depth: usize,
#[arg(long, short = 'j')]
pub json: bool,
}
pub fn run(args: &ImpactArgs, project_root: &Path) -> Result<()> {
eprintln!(
"Note: 'scope impact' is deprecated. Use 'scope callers {} --depth {}' instead.",
args.symbol, args.depth
);
let callers_args = CallersArgs {
symbol: args.symbol.clone(),
depth: args.depth,
limit: 20,
context: 0,
json: args.json,
};
run_callers_transitive(&callers_args, project_root, "impact")
}