mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-03 21:25:25 +00:00
internal: Replace Display impl for Name
This commit is contained in:
parent
2f840c2236
commit
c7ef6c25b7
108 changed files with 1045 additions and 656 deletions
|
|
@ -4,7 +4,7 @@
|
|||
use std::collections::hash_map::Entry;
|
||||
|
||||
use base_db::CrateId;
|
||||
use hir_expand::{attrs::AttrId, name::Name, AstId, MacroCallId};
|
||||
use hir_expand::{attrs::AttrId, db::ExpandDatabase, name::Name, AstId, MacroCallId};
|
||||
use itertools::Itertools;
|
||||
use once_cell::sync::Lazy;
|
||||
use profile::Count;
|
||||
|
|
@ -358,12 +358,16 @@ impl ItemScope {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn dump(&self, buf: &mut String) {
|
||||
pub(crate) fn dump(&self, db: &dyn ExpandDatabase, buf: &mut String) {
|
||||
let mut entries: Vec<_> = self.resolutions().collect();
|
||||
entries.sort_by_key(|(name, _)| name.clone());
|
||||
|
||||
for (name, def) in entries {
|
||||
format_to!(buf, "{}:", name.map_or("_".to_string(), |name| name.to_string()));
|
||||
format_to!(
|
||||
buf,
|
||||
"{}:",
|
||||
name.map_or("_".to_string(), |name| name.display(db).to_string())
|
||||
);
|
||||
|
||||
if def.types.is_some() {
|
||||
buf.push_str(" t");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue