diff options
author | Aleksey Kladov <[email protected]> | 2020-07-16 17:13:43 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-16 17:13:43 +0100 |
commit | a4e9681c79095d6c10a851cfefe64cf1a3570ec5 (patch) | |
tree | 7ffe79ebb62ca9aebd3dab258e6cd75987fb9913 /crates/rust-analyzer/src/cli.rs | |
parent | 29832b8c3db509dea8da9164e980ccac4bccf47d (diff) |
Better module structure
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(()) |