diff options
Diffstat (limited to 'crates/rust-analyzer/src/cli.rs')
-rw-r--r-- | crates/rust-analyzer/src/cli.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/rust-analyzer/src/cli.rs b/crates/rust-analyzer/src/cli.rs index 6863f100b..753001949 100644 --- a/crates/rust-analyzer/src/cli.rs +++ b/crates/rust-analyzer/src/cli.rs | |||
@@ -10,7 +10,7 @@ mod ssr; | |||
10 | use std::io::Read; | 10 | use std::io::Read; |
11 | 11 | ||
12 | use anyhow::Result; | 12 | use anyhow::Result; |
13 | use ra_ide::{file_structure, Analysis}; | 13 | use ra_ide::Analysis; |
14 | use ra_prof::profile; | 14 | use ra_prof::profile; |
15 | use ra_syntax::{AstNode, SourceFile}; | 15 | use ra_syntax::{AstNode, SourceFile}; |
16 | 16 | ||
@@ -48,8 +48,10 @@ pub fn parse(no_dump: bool) -> Result<()> { | |||
48 | } | 48 | } |
49 | 49 | ||
50 | pub fn symbols() -> Result<()> { | 50 | pub fn symbols() -> Result<()> { |
51 | let file = file()?; | 51 | let text = read_stdin()?; |
52 | for s in file_structure(&file) { | 52 | let (analysis, file_id) = Analysis::from_single_file(text); |
53 | let structure = analysis.file_structure(file_id).unwrap(); | ||
54 | for s in structure { | ||
53 | println!("{:?}", s); | 55 | println!("{:?}", s); |
54 | } | 56 | } |
55 | Ok(()) | 57 | Ok(()) |