diff options
Diffstat (limited to 'crates/ra_ide/src/display')
-rw-r--r-- | crates/ra_ide/src/display/function_signature.rs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/crates/ra_ide/src/display/function_signature.rs b/crates/ra_ide/src/display/function_signature.rs index ddc53a52b..1e4a472b4 100644 --- a/crates/ra_ide/src/display/function_signature.rs +++ b/crates/ra_ide/src/display/function_signature.rs | |||
@@ -169,9 +169,22 @@ impl From<&'_ ast::FnDef> for FunctionSignature { | |||
169 | res.push(self_param.syntax().text().to_string()) | 169 | res.push(self_param.syntax().text().to_string()) |
170 | } | 170 | } |
171 | 171 | ||
172 | res.extend(param_list.params().map(|param| { | 172 | res.extend( |
173 | param.pat().map(|pat| pat.syntax().text().to_string()).unwrap_or_default() | 173 | param_list |
174 | })); | 174 | .params() |
175 | .map(|param| { | ||
176 | Some( | ||
177 | param | ||
178 | .pat()? | ||
179 | .syntax() | ||
180 | .descendants() | ||
181 | .find_map(ast::Name::cast)? | ||
182 | .text() | ||
183 | .to_string(), | ||
184 | ) | ||
185 | }) | ||
186 | .map(|param| param.unwrap_or_default()), | ||
187 | ); | ||
175 | } | 188 | } |
176 | res | 189 | res |
177 | } | 190 | } |