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
.iter()
.skip(if function_signature.has_self_param { 1 } else { 0 })
.cloned()
.map(|name| name.trim_start_matches('_').into())
.collect();
builder = builder.add_call_parens(ctx, name, Params::Named(params));

View file

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