Add back Param struct
This commit is contained in:
parent
c6ddb90714
commit
04fc937700
@ -708,7 +708,7 @@ impl Function {
|
||||
Some(SelfParam { func: self.id })
|
||||
}
|
||||
|
||||
pub fn params(self, db: &dyn HirDatabase) -> Vec<Type> {
|
||||
pub fn params(self, db: &dyn HirDatabase) -> Vec<Param> {
|
||||
let resolver = self.id.resolver(db.upcast());
|
||||
let ctx = hir_ty::TyLoweringContext::new(db, &resolver);
|
||||
let environment = TraitEnvironment::lower(db, &resolver);
|
||||
@ -724,7 +724,7 @@ impl Function {
|
||||
environment: environment.clone(),
|
||||
},
|
||||
};
|
||||
ty
|
||||
Param { ty }
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
@ -754,6 +754,16 @@ impl From<Mutability> for Access {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Param {
|
||||
ty: Type,
|
||||
}
|
||||
|
||||
impl Param {
|
||||
pub fn ty(&self) -> &Type {
|
||||
&self.ty
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub struct SelfParam {
|
||||
func: FunctionId,
|
||||
|
@ -231,7 +231,7 @@ impl Completions {
|
||||
if let Some(pat) = it.pat() {
|
||||
let name = pat.to_string();
|
||||
let arg = name.trim_start_matches('_');
|
||||
return Some(add_arg(arg, ¶m_ty, ctx));
|
||||
return Some(add_arg(arg, param_ty.ty(), ctx));
|
||||
}
|
||||
None
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user