mirror of
https://github.com/colbymchenry/codegraph.git
synced 2026-10-18 22:02:49 +08:00
fix(rust): keep self method calls on the correct owner (#1882)
Fixes #1861. Reuses L4XB's receiver retention and owner resolution from #1866, with duplicate-owner and edit/sync guards. Co-authored-by: L4XB <lukas.buck@e-mail.de>
This commit is contained in:
@@ -894,9 +894,17 @@ impl<'t> Walker<'t> {
|
||||
_ => callee_name = method_name.to_string(),
|
||||
}
|
||||
}
|
||||
// `self.method()` — keep the `self.` prefix so the
|
||||
// resolver can read the owner off the calling
|
||||
// method's qualified name and resolve the method on
|
||||
// THAT type, instead of matching a bare name by file
|
||||
// proximity (#1861). Mirrors the wasm extractor.
|
||||
"self" => {
|
||||
callee_name = format!("self.{method_name}");
|
||||
}
|
||||
_ => {
|
||||
// parenthesized, await_expression, `self` —
|
||||
// bare method name.
|
||||
// parenthesized, await_expression — bare method
|
||||
// name.
|
||||
callee_name = method_name.to_string();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user