diff options
author | Nick Spain <[email protected]> | 2021-01-01 03:38:23 +0000 |
---|---|---|
committer | Nick Spain <[email protected]> | 2021-01-02 10:53:52 +0000 |
commit | 562e2ee28a4397878accfde014d68ab17d1b504a (patch) | |
tree | ef8b8040bd20ee82cd75a6004ddf4284b1aa23b8 /crates | |
parent | 14d0db0759c5b8e1d085ebab03a8b944a8921f2e (diff) |
Only log path and syntax range when processing function if source exists
Diffstat (limited to 'crates')
-rw-r--r-- | crates/rust-analyzer/src/cli/analysis_stats.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/rust-analyzer/src/cli/analysis_stats.rs b/crates/rust-analyzer/src/cli/analysis_stats.rs index bfc7d7b5a..9445aec07 100644 --- a/crates/rust-analyzer/src/cli/analysis_stats.rs +++ b/crates/rust-analyzer/src/cli/analysis_stats.rs | |||
@@ -161,12 +161,12 @@ impl AnalysisStatsCmd { | |||
161 | } | 161 | } |
162 | let mut msg = format!("processing: {}", full_name); | 162 | let mut msg = format!("processing: {}", full_name); |
163 | if verbosity.is_verbose() { | 163 | if verbosity.is_verbose() { |
164 | #[allow(deprecated)] | 164 | if let Some(src) = f.source(db) { |
165 | let src = f.source_old(db); | 165 | let original_file = src.file_id.original_file(db); |
166 | let original_file = src.file_id.original_file(db); | 166 | let path = vfs.file_path(original_file); |
167 | let path = vfs.file_path(original_file); | 167 | let syntax_range = src.value.syntax().text_range(); |
168 | let syntax_range = src.value.syntax().text_range(); | 168 | format_to!(msg, " ({} {:?})", path, syntax_range); |
169 | format_to!(msg, " ({} {:?})", path, syntax_range); | 169 | } |
170 | } | 170 | } |
171 | if verbosity.is_spammy() { | 171 | if verbosity.is_spammy() { |
172 | bar.println(msg.to_string()); | 172 | bar.println(msg.to_string()); |