aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/display/function_signature.rs
diff options
context:
space:
mode:
authorvsrs <[email protected]>2020-05-08 17:34:34 +0100
committervsrs <[email protected]>2020-05-08 17:34:34 +0100
commit0ef17ef1ee9fb0ce7149176d12f4d225f6d01401 (patch)
treefa2f168120f36f8dbef5dc1e85fea0c0071639c2 /crates/ra_ide/src/display/function_signature.rs
parent1be6320ea6cf7830195f80681fa0f43cc340da7e (diff)
parentd3eb9d8eafbebca7da95fa8a4813b92eb5080500 (diff)
Merge remote-tracking branch 'upstream/master' into uniformed_debug_lens
# Conflicts: # editors/code/src/commands/runnables.ts
Diffstat (limited to 'crates/ra_ide/src/display/function_signature.rs')
-rw-r--r--crates/ra_ide/src/display/function_signature.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/ra_ide/src/display/function_signature.rs b/crates/ra_ide/src/display/function_signature.rs
index db3907fe6..f16d42276 100644
--- a/crates/ra_ide/src/display/function_signature.rs
+++ b/crates/ra_ide/src/display/function_signature.rs
@@ -1,5 +1,7 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2 2
3// FIXME: this modules relies on strings and AST way too much, and it should be
4// rewritten (matklad 2020-05-07)
3use std::{ 5use std::{
4 convert::From, 6 convert::From,
5 fmt::{self, Display}, 7 fmt::{self, Display},
@@ -202,7 +204,11 @@ impl From<&'_ ast::FnDef> for FunctionSignature {
202 204
203 res.extend(param_list.params().map(|param| param.syntax().text().to_string())); 205 res.extend(param_list.params().map(|param| param.syntax().text().to_string()));
204 res_types.extend(param_list.params().map(|param| { 206 res_types.extend(param_list.params().map(|param| {
205 param.syntax().text().to_string().split(':').nth(1).unwrap()[1..].to_string() 207 let param_text = param.syntax().text().to_string();
208 match param_text.split(':').nth(1) {
209 Some(it) => it[1..].to_string(),
210 None => param_text,
211 }
206 })); 212 }));
207 } 213 }
208 (has_self_param, res, res_types) 214 (has_self_param, res, res_types)