diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index 3254f316b5..68ccedc60b 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs @@ -673,8 +673,13 @@ impl Function { Some(SelfParam { func: self.id }) } - pub fn params(self, db: &dyn HirDatabase) -> Vec { - db.function_data(self.id).params.clone() + pub fn params(self, db: &dyn HirDatabase) -> Vec { + db.function_data(self.id) + .params + .iter() + .skip(if self.self_param(db).is_some() { 1 } else { 0 }) + .map(|_| Param { _ty: () }) + .collect() } pub fn is_unsafe(self, db: &dyn HirDatabase) -> bool { @@ -707,6 +712,10 @@ pub struct SelfParam { func: FunctionId, } +pub struct Param { + _ty: (), +} + impl SelfParam { pub fn access(self, db: &dyn HirDatabase) -> Access { let func_data = db.function_data(self.func);