Properly name the field

This commit is contained in:
Kirill Bulatov
2020-10-02 21:38:22 +03:00
parent 99952f3be2
commit 9d19e5b962
8 changed files with 26 additions and 24 deletions

View File

@@ -36,11 +36,12 @@ pub fn diagnostics(path: &Path, load_output_dirs: bool, with_proc_macro: bool) -
for module in work {
let file_id = module.definition_source(db).file_id.original_file(db);
if !visited_files.contains(&file_id) {
let crate_name = if let Some(name) = module.krate().display_name(db) {
format!("{}", name)
} else {
String::from("unknown")
};
let crate_name = module
.krate()
.declaration_name(db)
.as_ref()
.map(ToString::to_string)
.unwrap_or_else(|| "unknown".to_string());
println!("processing crate: {}, module: {}", crate_name, _vfs.file_path(file_id));
for diagnostic in analysis.diagnostics(&DiagnosticsConfig::default(), file_id).unwrap()
{