Prefer hir::SelfParam and fix signature help of methods from macros

This commit is contained in:
oxalica 2023-08-09 02:42:08 +08:00
parent 6a2f83a8a2
commit de86444756
No known key found for this signature in database
GPG key ID: D425CB23CADE82D9
3 changed files with 27 additions and 7 deletions

View file

@ -560,8 +560,10 @@ impl<'db, 'sema> Matcher<'db, 'sema> {
placeholder_value.autoref_kind = self
.sema
.resolve_method_call_as_callable(code)
.and_then(|callable| callable.receiver_param(self.sema.db))
.map(|(self_param, _)| self_param.kind())
.and_then(|callable| {
let (self_param, _) = callable.receiver_param(self.sema.db)?;
Some(self_param.source(self.sema.db)?.value.kind())
})
.unwrap_or(ast::SelfParamKind::Owned);
}
}