use ide::{Analysis, FileStructureConfig};
use ide_db::base_db::AbsPathBuf;
use triomphe::Arc;
use crate::cli::{flags, read_stdin};
impl flags::Symbols {
pub fn run(self) -> anyhow::Result<()> {
let text = read_stdin()?;
let cwd = AbsPathBuf::assert_utf8(std::env::current_dir()?);
let (analysis, file_id) = Analysis::from_single_file(text, Arc::new(cwd));
let structure = analysis
.file_structure(&FileStructureConfig { exclude_locals: false }, file_id)
.unwrap();
for s in structure {
println!("{s:?}");
}
Ok(())
}
}