diff options
author | Yuki Kodama <[email protected]> | 2020-05-25 17:05:50 +0100 |
---|---|---|
committer | Yuki Kodama <[email protected]> | 2020-05-25 17:06:25 +0100 |
commit | fd83f469e9643c7a9da2d9e4c796bd89c441458d (patch) | |
tree | a326da5b86030d5d1fe94e1aaca30ebca342327b /crates/ra_ide | |
parent | 41d0f7f24ef924440ee710e134c01d6e47056c3f (diff) |
Trim at presentation layer
Diffstat (limited to 'crates/ra_ide')
-rw-r--r-- | crates/ra_ide/src/completion/presentation.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/display/function_signature.rs | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/crates/ra_ide/src/completion/presentation.rs b/crates/ra_ide/src/completion/presentation.rs index e59f730ff..61565c84f 100644 --- a/crates/ra_ide/src/completion/presentation.rs +++ b/crates/ra_ide/src/completion/presentation.rs | |||
@@ -211,7 +211,7 @@ impl Completions { | |||
211 | .parameter_names | 211 | .parameter_names |
212 | .iter() | 212 | .iter() |
213 | .skip(if function_signature.has_self_param { 1 } else { 0 }) | 213 | .skip(if function_signature.has_self_param { 1 } else { 0 }) |
214 | .cloned() | 214 | .map(|name| name.trim_start_matches('_').into()) |
215 | .collect(); | 215 | .collect(); |
216 | 216 | ||
217 | builder = builder.add_call_parens(ctx, name, Params::Named(params)); | 217 | builder = builder.add_call_parens(ctx, name, Params::Named(params)); |
diff --git a/crates/ra_ide/src/display/function_signature.rs b/crates/ra_ide/src/display/function_signature.rs index fabc78f14..9572debd8 100644 --- a/crates/ra_ide/src/display/function_signature.rs +++ b/crates/ra_ide/src/display/function_signature.rs | |||
@@ -237,9 +237,7 @@ impl From<&'_ ast::FnDef> for FunctionSignature { | |||
237 | .descendants() | 237 | .descendants() |
238 | .find_map(ast::Name::cast)? | 238 | .find_map(ast::Name::cast)? |
239 | .text() | 239 | .text() |
240 | .to_string() | 240 | .to_string(), |
241 | .trim_start_matches('_') | ||
242 | .into(), | ||
243 | ) | 241 | ) |
244 | }) | 242 | }) |
245 | .map(|param| param.unwrap_or_default()), | 243 | .map(|param| param.unwrap_or_default()), |