Skip to content

Add EnvironmentLoader for ruby-rbs crate - #3050

Draft
dak2 wants to merge 1 commit into
ruby:masterfrom
dak2:environment-loader-ruby-rbs-crate
Draft

Add EnvironmentLoader for ruby-rbs crate#3050
dak2 wants to merge 1 commit into
ruby:masterfrom
dak2:environment-loader-ruby-rbs-crate

Conversation

@dak2

@dak2 dak2 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Mirrors RBS::EnvironmentLoader: resolves core, library (with manifest.yaml dependency expansion), and explicit-directory sources in Ruby's load order, then parses each .rbs file once into an Environment.

#2954

Mirrors RBS::EnvironmentLoader: resolves core, library (with
manifest.yaml dependency expansion), and explicit-directory
sources in Ruby's load order, then parses each .rbs file once
into an Environment.

ruby#2954
}

impl EnvironmentLoader {
pub fn new() -> Self {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Make core_root and stdlib_root required arguments.

/// distinct entries yielded separately by `each_dir`.
Library {
name: String,
version: Option<String>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
version: Option<String>,
path: Path, // or some Path-ish attribute

Ruby runtime will fill the path for the library root, where adding sig dir name gives the path for the directory of RBS files.

/// stage on worker threads, which requires the loader holding this resolver to
/// be `Sync`; a supertrait cannot be added later without breaking downstream
/// implementations, so the bound is here from the start.
pub trait GemSigResolver: Send + Sync {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this trait is unnecessary. The library client would pass the resolved paths of each loaded gems.

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.

2 participants