mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Only log path and syntax range when processing function if source exists
This commit is contained in:
parent
14d0db0759
commit
562e2ee28a
1 changed files with 6 additions and 6 deletions
|
@ -161,13 +161,13 @@ impl AnalysisStatsCmd {
|
||||||
}
|
}
|
||||||
let mut msg = format!("processing: {}", full_name);
|
let mut msg = format!("processing: {}", full_name);
|
||||||
if verbosity.is_verbose() {
|
if verbosity.is_verbose() {
|
||||||
#[allow(deprecated)]
|
if let Some(src) = f.source(db) {
|
||||||
let src = f.source_old(db);
|
|
||||||
let original_file = src.file_id.original_file(db);
|
let original_file = src.file_id.original_file(db);
|
||||||
let path = vfs.file_path(original_file);
|
let path = vfs.file_path(original_file);
|
||||||
let syntax_range = src.value.syntax().text_range();
|
let syntax_range = src.value.syntax().text_range();
|
||||||
format_to!(msg, " ({} {:?})", path, syntax_range);
|
format_to!(msg, " ({} {:?})", path, syntax_range);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if verbosity.is_spammy() {
|
if verbosity.is_spammy() {
|
||||||
bar.println(msg.to_string());
|
bar.println(msg.to_string());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue