mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
the "add missing members" assists: implemented substitution of default values of const params
This commit is contained in:
parent
6918eb6ebd
commit
52b4392724
8 changed files with 127 additions and 52 deletions
|
@ -158,8 +158,14 @@ impl<'a> PathTransform<'a> {
|
|||
const_substs.insert(k, expr.syntax().clone());
|
||||
}
|
||||
}
|
||||
(Either::Left(_), None) => (), // FIXME: get default const value
|
||||
_ => (), // ignore mismatching params
|
||||
(Either::Left(k), None) => {
|
||||
if let Some(default) = k.default(db) {
|
||||
let default = ast::make::expr_const_value(&default);
|
||||
const_substs.insert(k, default.syntax().clone_for_update());
|
||||
// FIXME: transform the default value
|
||||
}
|
||||
}
|
||||
_ => (), // ignore mismatching params
|
||||
});
|
||||
let lifetime_substs: FxHashMap<_, _> = self
|
||||
.generic_def
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue