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

Autocompletion Meta Issue #445

Open
4 of 6 tasks
st0012 opened this issue Nov 17, 2022 · 0 comments
Open
4 of 6 tasks

Autocompletion Meta Issue #445

st0012 opened this issue Nov 17, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@st0012
Copy link
Member

st0012 commented Nov 17, 2022

Background

Since its introduction in version 1.4.0, the autocompletion feature has received mixed feedback. We can see many issues and comments in the repo mentioning its problems. Personally I find the feature useful and pretty like it, but I also experienced some problems with it.

However, many feedback were given through various channels (GH issues, Twitter, Slack channels...etc.). And from my experience, people mentioned different problems, not just one.

So I decided to reach out to the community to ask how they feel about this feature, as well as the specific problems they experienced. And then combine with feedback I collected from other channels, I would make a list of problems, so we can discuss and solve them more effectively.

My Poll Results

I did 2 polls, on one Twitter and another one on ruby.social:

Poll on Twitter Poll on ruby.social

We can see that in both polls:

  • Users generally feel this feature is helpful
  • But more than half of them think it has issues
  • There's a non-small percentage of users decided to disable it completely

Problems Collected From Users

Based on the comments from these polls as well as comments in related GH issues, I think we can list its common issues (ordered by frequency):

What's Next?

I'll open an issue for every problem if they don't already have one, start from the top of the list.

If the problem involves changing other libraries, like reline, I'll propose the changes on Ruby issue tracker as well (like this one for background colour issue). And in those issues/tickets, we can have more detailed discussions.

st0012 added a commit to st0012/irb that referenced this issue Dec 3, 2022
Currently, the only 2 ways to disable autocompletion are:

1. Create `.irbrc` and set `IRB.conf[:USE_AUTOCOMPLETE] = false`
2. Add the `--noautocomplete` flag when using the `irb` executable

Both of them are less convenient than setting a env var and are
lesser known to devs.

And given the number of problems the autocompletion has (see ruby#445), I
think we should allow disabling it with a simple `USE_AUTOCOMPLETE=false`.
st0012 added a commit to st0012/irb that referenced this issue Dec 5, 2022
Currently, the only 2 ways to disable autocompletion are:

1. Create `.irbrc` and set `IRB.conf[:USE_AUTOCOMPLETE] = false`
2. Add the `--noautocomplete` flag when using the `irb` executable

Both of them are less convenient than setting a env var and are
lesser known to devs.

And given the number of problems the autocompletion has (see ruby#445), I
think we should allow disabling it with a simple `USE_AUTOCOMPLETE=false`.
st0012 added a commit to st0012/irb that referenced this issue Dec 6, 2022
Currently, the only 2 ways to disable autocompletion are:

1. Create `.irbrc` and set `IRB.conf[:USE_AUTOCOMPLETE] = false`
2. Add the `--noautocomplete` flag when using the `irb` executable

Both of them are less convenient than setting a env var and are
lesser known to devs.

And given the number of problems the autocompletion has (see ruby#445), I
think we should allow disabling it with a simple `USE_AUTOCOMPLETE=false`.
st0012 added a commit to st0012/irb that referenced this issue Dec 6, 2022
Currently, the only 2 ways to disable autocompletion are:

1. Create `.irbrc` and set `IRB.conf[:USE_AUTOCOMPLETE] = false`
2. Add the `--noautocomplete` flag when using the `irb` executable

Both of them are less convenient than setting a env var and are
lesser known to devs.

And given the number of problems the autocompletion has (see ruby#445), I
think we should allow disabling it with a simple `USE_AUTOCOMPLETE=false`.
st0012 added a commit to st0012/irb that referenced this issue Dec 6, 2022
Currently, the only 2 ways to disable autocompletion are:

1. Create `.irbrc` and set `IRB.conf[:USE_AUTOCOMPLETE] = false`
2. Add the `--noautocomplete` flag when using the `irb` executable

Both of them are less convenient than setting a env var and are
lesser known to devs.

And given the number of problems the autocompletion has (see ruby#445), I
think we should allow disabling it with a simple `IRB_USE_AUTOCOMPLETE=false`.
st0012 added a commit to st0012/irb that referenced this issue Dec 6, 2022
Currently, the only 2 ways to disable autocompletion are:

1. Create `.irbrc` and set `IRB.conf[:USE_AUTOCOMPLETE] = false`
2. Add the `--noautocomplete` flag when using the `irb` executable

Both of them are less convenient than setting a env var and are
lesser known to devs.

And given the number of problems the autocompletion has (see ruby#445), I
think we should allow disabling it with a simple `IRB_USE_AUTOCOMPLETE=false`.
k0kubun pushed a commit that referenced this issue Dec 6, 2022
* Allow using IRB_USE_AUTOCOMPLETE=false to disable autocompletion

Currently, the only 2 ways to disable autocompletion are:

1. Create `.irbrc` and set `IRB.conf[:USE_AUTOCOMPLETE] = false`
2. Add the `--noautocomplete` flag when using the `irb` executable

Both of them are less convenient than setting a env var and are
lesser known to devs.

And given the number of problems the autocompletion has (see #445), I
think we should allow disabling it with a simple `IRB_USE_AUTOCOMPLETE=false`.

* Mention some env var configs in the README
st0012 added a commit to Shopify/rails that referenced this issue Dec 6, 2022
Reasons behind this change:

1. Autocompletion increases data transmission significantly. This could
   cause noticeable slowdown when connecting to remote servers, which is
   usually the case in production.
2. The autocompletion feature still has many issues, as listed in
   ruby/irb#445. They may be just annoying
   when happened locally, but in production they could cause real
   issues (e.g. typos caused by slow backspacing).

Due to these reasons, I think it's safer to disable this feature in
production.

About the implementation:

Because `IRB.start` doesn't take configuration arguments and rebuilds
the `IRB.conf` object, the only way we can turn off autocompletion is
through the `IRB_USE_AUTOCOMPLETE` env var.

The env var was added in ruby/irb#469 and will
be available for IRB 1.6+ and Ruby 3.2+.

The name wasn't used before so it won't cause issues with older IRB
versions.

Note: Users can still turn it back on with `IRB_USE_AUTOCOMPLETE=true`
@st0012 st0012 added the bug Something isn't working label Dec 27, 2022
@st0012 st0012 pinned this issue Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant