Skip to content

Add follow_method_alias query#779

Open
vinistock wants to merge 1 commit intomainfrom
05-04-add_follow_method_alias_query
Open

Add follow_method_alias query#779
vinistock wants to merge 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.

Co-authored-by: Soutaro Matsumoto <soutaro@users.noreply.github.com>
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
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.

1 participant