mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Implement basic inherent method resolution
This commit is contained in:
parent
e9e397e705
commit
082ef52bcb
11 changed files with 309 additions and 17 deletions
|
@ -43,6 +43,7 @@ impl FnSignature {
|
|||
.map(|n| n.as_name())
|
||||
.unwrap_or_else(Name::missing);
|
||||
let mut args = Vec::new();
|
||||
let mut has_self_arg = false;
|
||||
if let Some(param_list) = node.param_list() {
|
||||
if let Some(self_param) = param_list.self_param() {
|
||||
let self_type = if let Some(type_ref) = self_param.type_ref() {
|
||||
|
@ -60,6 +61,7 @@ impl FnSignature {
|
|||
}
|
||||
};
|
||||
args.push(self_type);
|
||||
has_self_arg = true;
|
||||
}
|
||||
for param in param_list.params() {
|
||||
let type_ref = TypeRef::from_ast_opt(param.type_ref());
|
||||
|
@ -75,6 +77,7 @@ impl FnSignature {
|
|||
name,
|
||||
args,
|
||||
ret_type,
|
||||
has_self_arg,
|
||||
};
|
||||
Arc::new(sig)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue