diff options
Diffstat (limited to 'crates/ide/src/display.rs')
-rw-r--r-- | crates/ide/src/display.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/ide/src/display.rs b/crates/ide/src/display.rs index 41b5bdc49..5bb065fc1 100644 --- a/crates/ide/src/display.rs +++ b/crates/ide/src/display.rs | |||
@@ -41,7 +41,13 @@ pub(crate) fn function_declaration(node: &ast::Fn) -> String { | |||
41 | format_to!(buf, "{}", type_params); | 41 | format_to!(buf, "{}", type_params); |
42 | } | 42 | } |
43 | if let Some(param_list) = node.param_list() { | 43 | if let Some(param_list) = node.param_list() { |
44 | format_to!(buf, "{}", param_list); | 44 | let mut params = match param_list.self_param() { |
45 | Some(self_param) => vec![self_param.to_string()], | ||
46 | None => vec![], | ||
47 | }; | ||
48 | params.extend(param_list.params().map(|param| param.to_string())); | ||
49 | // Useful to inline parameters | ||
50 | format_to!(buf, "({})", params.join(", ")); | ||
45 | } | 51 | } |
46 | if let Some(ret_type) = node.ret_type() { | 52 | if let Some(ret_type) = node.ret_type() { |
47 | if ret_type.ty().is_some() { | 53 | if ret_type.ty().is_some() { |