Skip to content

Add follow_method_alias query#779

Merged
vinistock merged 1 commit intomainfrom
05-04-add_follow_method_alias_query
May 7, 2026
Merged

Add follow_method_alias query#779
vinistock merged 1 commit intomainfrom
05-04-add_follow_method_alias_query

Conversation

@vinistock
Copy link
Copy Markdown
Member

@vinistock vinistock commented May 5, 2026

This PR extracts a portion of #697

The PR implements follow_method_alias, which accepts a definition_id for an alias and follows the chain until reaching the first concrete method definition. This is required to expose MethodDefinition#signatures in the Ruby API (as the definition may be an alias).

This PR also moves the core logic of finding members in the ancestor chain to query.rs, so that we can reuse it for this implementation and for the FFI.

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vinistock vinistock self-assigned this May 5, 2026
@vinistock vinistock added the enhancement New feature or request label May 5, 2026
Some(Receiver::SelfReceiver(def_id)) => {
return self.find_self_receiver_declaration(*def_id, *it.new_name_str_id());
}
Some(Receiver::ConstantReceiver(name_id)) => Some(name_id),
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were not handling constant receivers (e.g.: Foo.alias_method :bar, :baz), which ended up being surfaced in the new tests.

@vinistock vinistock marked this pull request as ready for review May 5, 2026 00:15
@vinistock vinistock requested a review from a team as a code owner May 5, 2026 00:15
Comment thread rust/rubydex/src/query.rs
@vinistock vinistock force-pushed the 05-04-add_follow_method_alias_query branch from ecf65ea to ffa0cfc Compare May 7, 2026 15:15
@vinistock vinistock requested a review from soutaro May 7, 2026 15:31
Co-authored-by: Soutaro Matsumoto <soutaro@users.noreply.github.com>
@vinistock vinistock force-pushed the 05-04-add_follow_method_alias_query branch from ffa0cfc to 73442de Compare May 7, 2026 21:17
@vinistock vinistock enabled auto-merge May 7, 2026 21:18
Copy link
Copy Markdown
Contributor

@soutaro soutaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@vinistock vinistock merged commit 8e66acf into main May 7, 2026
36 checks passed
@vinistock vinistock deleted the 05-04-add_follow_method_alias_query branch May 7, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants