diff options
Diffstat (limited to 'crates/ra_cli/src/analysis_stats.rs')
-rw-r--r-- | crates/ra_cli/src/analysis_stats.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/ra_cli/src/analysis_stats.rs b/crates/ra_cli/src/analysis_stats.rs index d355fa2e8..1fad5b233 100644 --- a/crates/ra_cli/src/analysis_stats.rs +++ b/crates/ra_cli/src/analysis_stats.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | use std::{collections::HashSet, fmt::Write, path::Path, time::Instant}; | 1 | use std::{collections::HashSet, fmt::Write, path::Path, time::Instant}; |
2 | 2 | ||
3 | use ra_db::SourceDatabase; | 3 | use ra_db::SourceDatabase; |
4 | use ra_hir::{Crate, HasBodySource, HasSource, HirDisplay, ImplItem, ModuleDef, Ty}; | 4 | use ra_hir::{Crate, HasBodySource, HasSource, HirDisplay, ImplItem, ModuleDef, Ty, TypeWalk}; |
5 | use ra_syntax::AstNode; | 5 | use ra_syntax::AstNode; |
6 | 6 | ||
7 | use crate::Result; | 7 | use crate::Result; |
@@ -110,9 +110,12 @@ pub fn run(verbose: bool, memory_usage: bool, path: &Path, only: Option<&str>) - | |||
110 | let original_file = src.file_id.original_file(db); | 110 | let original_file = src.file_id.original_file(db); |
111 | let path = db.file_relative_path(original_file); | 111 | let path = db.file_relative_path(original_file); |
112 | let line_index = host.analysis().file_line_index(original_file).unwrap(); | 112 | let line_index = host.analysis().file_line_index(original_file).unwrap(); |
113 | let text_range = src | ||
114 | .ast | ||
115 | .either(|it| it.syntax().text_range(), |it| it.syntax().text_range()); | ||
113 | let (start, end) = ( | 116 | let (start, end) = ( |
114 | line_index.line_col(src.ast.syntax().text_range().start()), | 117 | line_index.line_col(text_range.start()), |
115 | line_index.line_col(src.ast.syntax().text_range().end()), | 118 | line_index.line_col(text_range.end()), |
116 | ); | 119 | ); |
117 | bar.println(format!( | 120 | bar.println(format!( |
118 | "{} {}:{}-{}:{}: Expected {}, got {}", | 121 | "{} {}:{}-{}:{}: Expected {}, got {}", |