Proposal: Extend `ruby-rbs` crate features
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 2.2k
- Forks
- 256
- Avg merge
- 6d 17h
- Merged PRs (30d)
- 37
Description
Motivation
The ruby-rbs crate currently provides only the parser layer (AST + Visit trait).
The rbs gem, in contrast, ships several higher-level layers on top of the parser — environment construction, name resolution, and definition (ancestor / method) resolution.
Until those layers exist on the Rust side, downstream tooling (type checkers, LSP servers, code generators) cannot be built using ruby-rbs alone. This issue proposes to gradually port those upper layers into the crate.
Features I want
I'm building a static type checker in Rust for my own gem.
Currently, RBS type definitions are loaded on the Ruby side and the result is then handed over to Rust for analysis.
I'd like to move the loading step into Rust as well, so the whole pipeline can be driven through a Rust interface — which requires the following layers in ruby-rbs:
TypeName/Namespace— structured type names like::Foo::Bar; prerequisite for every layer belowEnvironmentLoader— discovering.rbsfiles from gem paths / libdirs, equivalent torbsgem's loaderEnvironment— merging declarations from multiple files (class reopens, module aliases) and exposing a lookup APIDefinitionBuilder— resolving inherited methods via MRO so callers can ask "what methods doesFoo::Barexpose?" without re-implementing ancestor traversal in every consumer
Of course, things won’t always go as planned.
Willingness to contribute
If the RBS core team is planning to expand ruby-rbs with these upper layers, I'd love to contribute actively — not just file this as a wishlist.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing ruby-rbs crate and the corresponding upper layers in the rbs gem. The proposal covers TypeName/Namespace, EnvironmentLoader, Environment, and DefinitionBuilder, so first determine which layer and scope the project will accept. Done would require an agreed Rust interface and implementation plan rather than a single isolated edit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby, rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100