mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
internal: Handle fields called as method calls as the fields they resolve to
This commit is contained in:
parent
b85e2af898
commit
5a91f015b4
4 changed files with 63 additions and 4 deletions
|
@ -469,9 +469,12 @@ impl NameRefClass {
|
|||
match_ast! {
|
||||
match parent {
|
||||
ast::MethodCallExpr(method_call) => {
|
||||
sema.resolve_method_call(&method_call)
|
||||
.map(Definition::Function)
|
||||
.map(NameRefClass::Definition)
|
||||
sema.resolve_method_call_field_fallback(&method_call)
|
||||
.map(|it| {
|
||||
it.map_left(Definition::Function)
|
||||
.map_right(Definition::Field)
|
||||
.either(NameRefClass::Definition, NameRefClass::Definition)
|
||||
})
|
||||
},
|
||||
ast::FieldExpr(field_expr) => {
|
||||
sema.resolve_field(&field_expr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue