Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/pretty.rs')
| -rw-r--r-- | crates/hir-def/src/pretty.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/crates/hir-def/src/pretty.rs b/crates/hir-def/src/pretty.rs index eb9488feaa..c431b45dc7 100644 --- a/crates/hir-def/src/pretty.rs +++ b/crates/hir-def/src/pretty.rs @@ -80,7 +80,16 @@ pub(crate) fn print_path( } PathKind::Crate => write!(buf, "crate")?, PathKind::Abs => {} - PathKind::DollarCrate(_) => write!(buf, "$crate")?, + PathKind::DollarCrate(krate) => write!( + buf, + "{}", + krate + .extra_data(db) + .display_name + .as_ref() + .map(|it| it.crate_name().symbol().as_str()) + .unwrap_or("$crate") + )?, }, } |