Allow autosuggestions to be configurable.#13475
Conversation
| enable_autosuggestions = Bool(True, | ||
| help="Allows to enable/disable the prompt autosuggestions based on " | ||
| "the prompt toolkit history.", | ||
| ).tag(config=True) | ||
|
|
There was a problem hiding this comment.
Just thinking at loud, do you think there might be other source of autosuggestions we could have latter ? Would it make sens to make that a string, so we can select from multiple sources later ?
There was a problem hiding this comment.
Yes, that is a possibility. I had a look at prompt_toolkit and they have the infrastructure in place but as that are of their code has not changed in the last two years it feels like that might not happen in the near future.
Of course there are other autosuggestion sources under development (Kite, IntelliCode) but I guess that requires a much larger integration effort and then this configuration option has to change in any case.
There was a problem hiding this comment.
So to make this a bit more future-proof I changed this to a string. That was definitely a good suggestion.
Additionally it can be changed in a running terminal which might be useful as well.
|
Yep, I think that's good. |
|
(just removed a bit of code that was likely copy-pasted by mistake), will mege once test are apssing. |
|
Great, thanks for catching that. It should all work now as intended. |
|
Thanks for adding this feature to the next release. |
|
HI, can Or, do I have to rework the setting each time I install and use Is there something wrong with using |
|
Issues with having it opt-in is it's non discoverable. You do not need to do it on a per-env basis, you can use a global config file. |
The new autosuggestion feature can save a lot of typing and allows a quicker workflow in REPL but as this is a prominent UI change this should be configurable.
This patch allows via the normal configuration mechanisms to enable / disable the autosuggestion feature while keeping the current default value.
This would address #13451.
Of course glad about any feedback!