Better module structure

This commit is contained in:
Aleksey Kladov
2020-07-16 18:13:43 +02:00
parent 29832b8c3d
commit a4e9681c79
4 changed files with 30 additions and 27 deletions

View File

@@ -10,7 +10,7 @@ mod ssr;
use std::io::Read;
use anyhow::Result;
use ra_ide::{file_structure, Analysis};
use ra_ide::Analysis;
use ra_prof::profile;
use ra_syntax::{AstNode, SourceFile};
@@ -48,8 +48,10 @@ pub fn parse(no_dump: bool) -> Result<()> {
}
pub fn symbols() -> Result<()> {
let file = file()?;
for s in file_structure(&file) {
let text = read_stdin()?;
let (analysis, file_id) = Analysis::from_single_file(text);
let structure = analysis.file_structure(file_id).unwrap();
for s in structure {
println!("{:?}", s);
}
Ok(())