Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't load gem's rbs if rbs_collection.yaml exists #43

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

tompng
Copy link
Member

@tompng tompng commented Dec 9, 2024

In rbs_collection.yaml, some gems can be ignored.

Ignored gems might have huge/heavy rbs files.

# gems:
#   # If you want to avoid installing rbs files for gems, you can specify them here.
#   - name: GEM_NAME
#     ignore: true

ReplTypeCompletor should follow rbs_collection.yaml configuration. When config file exists, additional gem's rbs file shouldn't be loaded.

In rbs_collection.yaml, some gems can be ignored.
ReplTypeCompletor should follow rbs_collection.yaml configuration.
When config file exists, additional gem's rbs file shouldn't be loaded.
gem_sig_path = File.expand_path("#{spec.gem_dir}/sig")
loader.add(library: spec.name, version: spec.version) if Dir.exist?(gem_sig_path) && expanded_sig_path != gem_sig_path

unless File.exist?('rbs_collection.yaml')
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if the same principle applies to RBS collection, but when working with dependency declaration files, like Gemfile, it's better to check the lock file's presence too to make sure the project has properly set up the environment.
It will be a very rare case to have users running repl_type_completor with rbs_collection.yaml but without lockfile tho.

@ima1zumi ima1zumi merged commit cbb2cfb into main Dec 12, 2024
28 checks passed
@ima1zumi ima1zumi deleted the follow_rbs_collection_yaml branch December 12, 2024 14:34
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.

3 participants