diff options
author | Benjamin Coenen <[email protected]> | 2020-04-21 13:31:57 +0100 |
---|---|---|
committer | Benjamin Coenen <[email protected]> | 2020-04-21 13:31:57 +0100 |
commit | 1c3a1385a587f0713908c0ae888ffad31f13de11 (patch) | |
tree | c1f1ea8d9575670d36c09bc7a9c0c0e34fee89d5 /crates/ra_ide/src/display/function_signature.rs | |
parent | af3c19e85f55db9277ce9ad5b784df2ccfe3c9e4 (diff) |
Improve autocompletion by looking on the type and name
Signed-off-by: Benjamin Coenen <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/display/function_signature.rs')
-rw-r--r-- | crates/ra_ide/src/display/function_signature.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/crates/ra_ide/src/display/function_signature.rs b/crates/ra_ide/src/display/function_signature.rs index 2d175882b..b5e2785fe 100644 --- a/crates/ra_ide/src/display/function_signature.rs +++ b/crates/ra_ide/src/display/function_signature.rs | |||
@@ -73,7 +73,7 @@ impl FunctionSignature { | |||
73 | if let Some(param_type) = raw_param.split(':').nth(1) { | 73 | if let Some(param_type) = raw_param.split(':').nth(1) { |
74 | parameter_types.push(param_type[1..].to_string()); | 74 | parameter_types.push(param_type[1..].to_string()); |
75 | } else { | 75 | } else { |
76 | // The unwrap_or_else is useful when you have tuple struct | 76 | // useful when you have tuple struct |
77 | parameter_types.push(raw_param.clone()); | 77 | parameter_types.push(raw_param.clone()); |
78 | } | 78 | } |
79 | params.push(raw_param); | 79 | params.push(raw_param); |
@@ -177,7 +177,6 @@ impl From<&'_ ast::FnDef> for FunctionSignature { | |||
177 | has_self_param = true; | 177 | has_self_param = true; |
178 | let raw_param = self_param.syntax().text().to_string(); | 178 | let raw_param = self_param.syntax().text().to_string(); |
179 | 179 | ||
180 | // FIXME: better solution ? | ||
181 | res_types.push( | 180 | res_types.push( |
182 | raw_param.split(':').nth(1).unwrap_or_else(|| " Self")[1..].to_string(), | 181 | raw_param.split(':').nth(1).unwrap_or_else(|| " Self")[1..].to_string(), |
183 | ); | 182 | ); |