]>
Commit | Line | Data |
---|---|---|
064997fb FG |
1 | //! Read Rust code on stdin, print syntax tree on stdout. |
2 | use ide::Analysis; | |
3 | ||
4 | use crate::cli::{flags, read_stdin}; | |
5 | ||
6 | impl flags::Symbols { | |
7 | pub fn run(self) -> anyhow::Result<()> { | |
8 | let text = read_stdin()?; | |
9 | let (analysis, file_id) = Analysis::from_single_file(text); | |
10 | let structure = analysis.file_structure(file_id).unwrap(); | |
11 | for s in structure { | |
f25598a0 | 12 | println!("{s:?}"); |
064997fb FG |
13 | } |
14 | Ok(()) | |
15 | } | |
16 | } |