-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[SUSPENDED] REPL shows quick fixes [ci: last-only] #10499
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
base: 2.13.x
Are you sure you want to change the base?
Conversation
f3067a1
to
20ecf9d
Compare
Test shows which error currently has a quick fix.
Rust underlines the modification.
An alternative 5-character prompt:
|
20ecf9d
to
7cdbf68
Compare
It should obey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be nice to have this in the release 👍
Maybe bad idea: store the quickfixed version in the REPL history instead of the original one?
I, too, thought of putting the edit in history; I'm glad you like my bad idea. That is easier than cut/paste. I deferred handling multi-line, but the goal is probably to do something nicer. I didn't test multi-warn, but the goal was one quick prompt with a long comment. Thanks for trying it out. I'll make an effort to finish it up, given your feedback. |
@som-snytt ready to return this? this is one I'm especially eager to see land |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
7cdbf68
to
64f4a14
Compare
64f4a14
to
b1389bc
Compare
@SethTisue since you added the prio:hi label, can you take a look? |
b1389bc
to
117885b
Compare
117885b
to
68d29fd
Compare
Oh wait, they removed After I get the previous effort to green check, I would prefer that the REPL emit the amended line just once, when all reporting is done. Adding the amended line to history would require all edits. I recall from last summer that Since I'm not very motivated, maybe the current solution suffices. |
@SethTisue is going to take a look right after reviewing that other PR. Marking RFR so I don't forget. |
Code changes seem fine. I'm less sure about the UX. Let's start by recalling the existing behavior (in 2.13.12), for comparison: ![]() Here the new behavior with the same all-in-one-line example ![]() and I think this what Som means by "I deferred handling multi-line, but the goal is probably to do something nicer" : ![]() because the fix isn't on the first line, we don't get the The one-line example above seems pretty confusing to me. If a beginner saw this and didn't know anything about any of this, I think there's a good chance they'd be somewhat bewildered. The multi-line screen shot is less featureful, but perhaps also less confusing. It fixed it for me without printing a bunch of potentially confusing extra stuff. @som-snytt how attached are you to this The placement of
In the multiline case, it would be annoying to repeat an entire long piece of code just to show a one-line change. A slightly more ambitious change that would scale well to multiple lines and multiple quickfixes would be to use diff markers, like this:
Wdyt? Separate question: not sure it's desirable to always simply apply the fix. Have you considered a
For 2.13.13, I'm not sure whether to just say (as Adriaan used to) "let's book the progress". We don't know how much time we have (since we are waiting on 3.4.0), and also @som-snytt I don't know how much appetite you have for tinkering with this further, and or your opinions on my suggestions above. Thoughts? |
I'll close this because I won't be researching the text presentation. I'll look at whether the tweak to how edits are applied is worth using. The goal was naive users get to see their mistakes auto-corrected in REPL. |
A year later, it looks like a neat idea. |
Fixes scala/bug#12844