Improve parameter hints a bit & add emacs support
- just include the name, not e.g. `mut` - don't return empty hints (or `_`)
This commit is contained in:
@@ -169,9 +169,22 @@ impl From<&'_ ast::FnDef> for FunctionSignature {
|
||||
res.push(self_param.syntax().text().to_string())
|
||||
}
|
||||
|
||||
res.extend(param_list.params().map(|param| {
|
||||
param.pat().map(|pat| pat.syntax().text().to_string()).unwrap_or_default()
|
||||
}));
|
||||
res.extend(
|
||||
param_list
|
||||
.params()
|
||||
.map(|param| {
|
||||
Some(
|
||||
param
|
||||
.pat()?
|
||||
.syntax()
|
||||
.descendants()
|
||||
.find_map(ast::Name::cast)?
|
||||
.text()
|
||||
.to_string(),
|
||||
)
|
||||
})
|
||||
.map(|param| param.unwrap_or_default()),
|
||||
);
|
||||
}
|
||||
res
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user