aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/display.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-09-15 17:18:30 +0100
committerGitHub <[email protected]>2020-09-15 17:18:30 +0100
commit37f3b9ca2a0252b93c5900e2104e3e954c383869 (patch)
tree51ca21399d11ebbc1337c0837d17a6523056bd0e /crates/ide/src/display.rs
parentf514965c519521246696365e3ca2227c31d3cf08 (diff)
parente0f0d93eda8fbcd523187ef29b713acb9a92cb6f (diff)
Merge #6008
6008: inline parameters for a function description r=jonas-schievink a=bnjjj close #6002 Co-authored-by: Benjamin Coenen <[email protected]>
Diffstat (limited to 'crates/ide/src/display.rs')
-rw-r--r--crates/ide/src/display.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/ide/src/display.rs b/crates/ide/src/display.rs
index 41b5bdc49..2484dbbf1 100644
--- a/crates/ide/src/display.rs
+++ b/crates/ide/src/display.rs
@@ -41,7 +41,14 @@ 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 params: Vec<String> = param_list
45 .self_param()
46 .into_iter()
47 .map(|self_param| self_param.to_string())
48 .chain(param_list.params().map(|param| param.to_string()))
49 .collect();
50 // Useful to inline parameters
51 format_to!(buf, "({})", params.join(", "));
45 } 52 }
46 if let Some(ret_type) = node.ret_type() { 53 if let Some(ret_type) = node.ret_type() {
47 if ret_type.ty().is_some() { 54 if ret_type.ty().is_some() {