-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
add support for automatic bracket completion in REPL input #59847
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
Conversation
I tried this now (with OhMyREPL) and I think you should rather have it on by default! Just as people my overlook enabling (and install OhMyREPL before), I think people will simply welcome this and could then disable if not. |
I am one of those people that does not want this feature enabled by default. I think for IDEs it can make sense to enable by default, but I don't interact with a terminal-based REPL like I do an IDE. |
As someone who does tend to use the REPL a bit like a mini-IDE, I'd be interested to know what the usecase that's hurt by this being enabled is, if you're interested in elaborating. |
Right; @StevenWhitaker, please try "using OhMyREPL". I though it might interfere, but realized you can overwrite the ) it generates, i.e. type as you would usually, seemingly (I've yet to test it extensively, even though I knew of the package from way back, before its name change...), I think it should bother no one if enabled. At least then can be disabled. That way won't be overlooked. |
6266cac
to
6f38ab3
Compare
@tecosaur if I am typing directly into the REPL, it is going to be a single (possibly long) line; if it's anything more than that, I press Alt-e and now I'm in an editor, not the REPL. If I want easy cursor movements, code movements, jump to matching bracket, etc., I will use an editor. As a result, I expect the REPL not to do IDE-like things. Now, as for bracket completion specifically, in other settings (though I can't remember the details at the moment), there have been times where I type a bracket, only to delete it, but it doesn't delete the auto-added closing bracket (that wouldn't be there otherwise) so I have to interrupt my train of thought to delete it. Granted, it's not a huge inconvenience, but still, it was inconvenient enough that I remember having the issue. Example below. In this example,
I know in this simple case bracket autocompletion tools typically automatically remove the It's also a mental burden not knowing if I can press @PallHaraldsson I did try OhMyREPL.jl a few years ago, but I actually disabled bracket completion. I don't remember why, though, maybe it was related to what I mentioned above. |
6f38ab3
to
6b053e3
Compare
@StevenWhitaker I agree that it is annoying when it doesn't work as expected. I've thought a bit, and I think having it on by default in the beginning has to be done exactly in order to find out issues where it misbehaves. Based on feedback we can then later take stock of what should be done for the actual release. |
6b053e3
to
5557a87
Compare
@KristofferC that make sense. Also, to be clear, it's not like I'll stop using Julia if this feature is on by default 😂 I just saw there was a comment in favor of having it on by default, so I wanted to raise awareness that there is at least one person who prefers otherwise. And if all the kinks get ironed out, I might change my mind 😄 |
This ports the bracket completion feature from OhMyREPL (https://kristofferc.github.io/OhMyREPL.jl/latest/features/bracket_complete/) to the Julia REPL. It is disabled by default because I am not sure if this is an obvious feature that everyone wants to have.
This feature looks in practice like:
Screen.Recording.2025-10-15.at.13.19.42.mov
With this and #59819 all features (excpet perhaps a good API for https://kristofferc.github.io/OhMyREPL.jl/latest/features/prompt/) have been ported to the Julia REPL and OhMyREPL can be deprecated.