mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Trim at presentation layer
This commit is contained in:
parent
41d0f7f24e
commit
fd83f469e9
2 changed files with 2 additions and 4 deletions
|
@ -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));
|
||||||
|
|
|
@ -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()),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue