Skip to content

feat(code-intel): resolve Type::method calls so callers, impact and trace stop merging same-named methods - #738

Merged
ajianaz merged 1 commit into
developfrom
feat/call-graph-type-qualifier
Nov 16, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/call-graph-type-qualifier

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

What

Rust call sites now record the type or module the call was made through (Type::f(), module::f(), and self.f() / Self::f() resolved to the enclosing impl type, macro arguments included), plus the impl type of the caller, in two new call_graph columns (schema 9).

  • cora callers accepts name, Type::name or a bare type name. Type::name matches calls through that type plus ambiguous calls whose receiver type is unknown; the new --strict flag drops the ambiguous ones.
  • impact follows (type, name) nodes, so same-named methods of other types no longer widen the result.
  • Bare-name queries behave as before. Existing indexes migrate to schema 9 and fill the qualifiers on the next cora index.

Why

The call graph was keyed by the bare callee name: every from_env in a workspace merged into one node, and a type name was never a call target, so callers WebFetchTool found nothing. Closes #714.

Testing

  • New unit tests: qualifier extraction (type path, turbofish, self/Self, ambiguous receiver, macro arguments), qualified and strict find_callers, type-name queries, typed impact, query parsing, and the v9 migration.
  • Fixture project: callers WebSearchTool::from_env lists only its real callers, callers WebFetchTool lists the calls through the type, --strict hides the untyped receiver.
  • On this repository: callers default 52 results, callers Config::default 8; impact Config::default 57 affected.
  • cargo fmt --all -- --check, cargo clippy --all-targets --features tree-sitter -- -D warnings, cargo test --features tree-sitter (1359 passed), cora review --base origin/develop: no issues.

…race stop merging same-named methods (#714)

The call graph was keyed by the bare callee name, so every from_env in a
workspace merged into one node, and a type name was never a call target.

Rust call sites now record the type or module the call was made through
(Type::f(), module::f(), self.f() and Self::f() resolve to the impl type,
macro arguments included) together with the impl type of the caller, in two
new call_graph columns (schema 9). callers accepts name, Type::name or a type
name; Type::name matches calls through that type plus ambiguous calls whose
receiver type is unknown, and --strict drops the ambiguous ones. impact
follows (type, name) nodes. Bare-name queries behave as before.
@ajianaz
ajianaz merged commit e01a4c3 into develop Nov 16, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(code-intel): calls resolve by bare function name; Type::method and use paths are not resolved (callers, impact, trace, affected inflate or miss)

1 participant