Skip to content

Expose mixin locations#837

Open
Morriar wants to merge 2 commits into
mainfrom
add-mixin-locations
Open

Expose mixin locations#837
Morriar wants to merge 2 commits into
mainfrom
add-mixin-locations

Conversation

@Morriar

@Morriar Morriar commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add Mixin#location to the Ruby API.
  • Track mixin offsets in Rust so the location covers the full include / prepend / extend expression, not just the referenced constant.
  • Add Ruby API signatures and coverage for include, prepend, and extend locations.

Morriar added 2 commits May 29, 2026 12:57
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
@Morriar Morriar requested a review from a team as a code owner May 29, 2026 16:58
@Morriar Morriar self-assigned this May 29, 2026
@vinistock

Copy link
Copy Markdown
Member

As discussed on Slack, I think we don't need to pay the memory price to remember the full mixin's location. Especially considering that someone can do multiple operations in a single line, which diminishes the relevance of the mixin location vs the constant reference location.

For example:

class Foo
  include Bar, Baz, Qux
end

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.

5 participants