mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Allow adding partially resolved types
This commit is contained in:
parent
e1099aaa57
commit
03291db801
2 changed files with 47 additions and 4 deletions
|
@ -567,7 +567,27 @@ impl HirDisplay for Ty {
|
|||
};
|
||||
if !parameters_to_write.is_empty() {
|
||||
write!(f, "<")?;
|
||||
f.write_joined(parameters_to_write, ", ")?;
|
||||
|
||||
if f.display_target.is_source_code() {
|
||||
let mut first = true;
|
||||
for generic_arg in parameters_to_write {
|
||||
if !first {
|
||||
write!(f, ", ")?;
|
||||
}
|
||||
first = false;
|
||||
|
||||
if generic_arg.ty(Interner).map(|ty| ty.kind(Interner))
|
||||
== Some(&TyKind::Error)
|
||||
{
|
||||
write!(f, "_")?;
|
||||
} else {
|
||||
generic_arg.hir_fmt(f)?;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
f.write_joined(parameters_to_write, ", ")?;
|
||||
}
|
||||
|
||||
write!(f, ">")?;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue