rbs icon indicating copy to clipboard operation
rbs copied to clipboard

Support auto extending module (via AncestorBuilder)

Open tk0miya opened this issue 2 years ago • 0 comments

In Ruby language, developers need to use both "include" and "extend" to implement mix-in having instance methods and class methods. The auto extending module is a well-known technique to realize it (ex. ActiveSupport::Concern, "extend" call in included block, and so on).

This supports the auto extending modules via modules having "autoextend:..." annotation. The RBS::DefinitionBuilder searches the extended modules from the annotations of the included modules.

This is yet another version of #1503. This modifies RBS::DefinitionBuilder::AncestorBuilder#one_singleton_ancestors to get auto-extending modules.

  • pros
    • Simple feature and simple implementation
  • cons
    • Do not support nested auto-extend (recursively) as ActiveSupport::Concern does.

tk0miya avatar Oct 01 '23 05:10 tk0miya