mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Pretty print root module of extern crates
This commit is contained in:
parent
7c855c940a
commit
73fc05fdca
1 changed files with 4 additions and 0 deletions
|
@ -431,6 +431,10 @@ impl HirDisplay for Module {
|
|||
// FIXME: Module doesn't have visibility saved in data.
|
||||
match self.name(f.db) {
|
||||
Some(name) => write!(f, "mod {}", name),
|
||||
None if self.crate_root(f.db) == *self => match self.krate().display_name(f.db) {
|
||||
Some(name) => write!(f, "extern crate {}", name),
|
||||
None => write!(f, "extern crate {{unknown}}"),
|
||||
},
|
||||
None => write!(f, "mod {{unnamed}}"),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue