mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Fill in type params in 'add missing impl members' assist
This commit is contained in:
parent
aa49b79bda
commit
c39352fa43
5 changed files with 151 additions and 37 deletions
|
@ -644,6 +644,17 @@ impl_froms!(
|
|||
Const
|
||||
);
|
||||
|
||||
impl GenericDef {
|
||||
pub fn params(self, db: &impl HirDatabase) -> Vec<TypeParam> {
|
||||
let generics: Arc<hir_def::generics::GenericParams> = db.generic_params(self.into());
|
||||
generics
|
||||
.types
|
||||
.iter()
|
||||
.map(|(local_id, _)| TypeParam { id: TypeParamId { parent: self.into(), local_id } })
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
pub struct Local {
|
||||
pub(crate) parent: DefWithBody,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue