mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Remove parameter names from function item tree
This commit is contained in:
parent
513d4a9c9a
commit
79c4c4fb48
5 changed files with 15 additions and 33 deletions
|
@ -257,21 +257,15 @@ impl<'a> Printer<'a> {
|
|||
w!(self, "(");
|
||||
if !params.is_empty() {
|
||||
self.indented(|this| {
|
||||
for (i, param) in params.clone().enumerate() {
|
||||
for param in params.clone() {
|
||||
this.print_attrs_of(param);
|
||||
match &this.tree[param] {
|
||||
Param::Normal(name, ty) => {
|
||||
match name {
|
||||
Some(name) => w!(this, "{}: ", name),
|
||||
None => w!(this, "_: "),
|
||||
Param::Normal(ty) => {
|
||||
if flags.contains(FnFlags::HAS_SELF_PARAM) {
|
||||
w!(this, "self: ");
|
||||
}
|
||||
this.print_type_ref(ty);
|
||||
w!(this, ",");
|
||||
if flags.contains(FnFlags::HAS_SELF_PARAM) && i == 0 {
|
||||
wln!(this, " // self");
|
||||
} else {
|
||||
wln!(this);
|
||||
}
|
||||
wln!(this, ",");
|
||||
}
|
||||
Param::Varargs => {
|
||||
wln!(this, "...");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue