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

Change default completor from regexp to type-completor #1010

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tompng
Copy link
Member

@tompng tompng commented Sep 30, 2024

IRB will use type completor as default. If repl_type_completor is not available (not installed or not added to Gemfile), fallbacks to RegexpCompletor.

When type completor is not available, IRB shows warning message only If --type-completor or IRB.conf[:COMPLETOR] = :type is explicitly specified.

$ irb -f
irb(main):001> irb_info
(TypeCompletor)

$ echo "gem 'irb', path: 'path/to/irb'" > Gemfile

$ bundle exec irb -f
(no waarning)
irb(main):001> irb_info
(RegexpCompletor)

$ bundle exec irb -f --type-completor
TypeCompletor requires `gem repl_type_completor`: cannot load such file -- repl_type_completor
irb(main):001> irb_info
(RegexpCompletor)

@st0012
Copy link
Member

st0012 commented Oct 1, 2024

Since repl_type_completor only has ~64k downloads atm, this means almost all IRB sessions after this change will trigger a LoadError unnecessarily. And at the same time, this change isn't actually making more people use repl_type_completor. It simply saves the existing users the need to configure it.

IMO the right solution here is to propose making repl_type_completor a bundled gem. And only until that happens, we make it a default for IRB with a Ruby version check as older Ruby versions still won't have it installed by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants