Trim at presentation layer

This commit is contained in:
Yuki Kodama 2020-05-26 01:05:50 +09:00
parent 41d0f7f24e
commit fd83f469e9
2 changed files with 2 additions and 4 deletions

View file

@ -211,7 +211,7 @@ impl Completions {
.parameter_names .parameter_names
.iter() .iter()
.skip(if function_signature.has_self_param { 1 } else { 0 }) .skip(if function_signature.has_self_param { 1 } else { 0 })
.cloned() .map(|name| name.trim_start_matches('_').into())
.collect(); .collect();
builder = builder.add_call_parens(ctx, name, Params::Named(params)); builder = builder.add_call_parens(ctx, name, Params::Named(params));

View file

@ -237,9 +237,7 @@ impl From<&'_ ast::FnDef> for FunctionSignature {
.descendants() .descendants()
.find_map(ast::Name::cast)? .find_map(ast::Name::cast)?
.text() .text()
.to_string() .to_string(),
.trim_start_matches('_')
.into(),
) )
}) })
.map(|param| param.unwrap_or_default()), .map(|param| param.unwrap_or_default()),