-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
REPL aggressively uses wrong autocomplete on ENTER #42040
Comments
I am able to reproduce this in both v16 latest and master. I think the ask here is reasonable and this isn't really a hard fix but I'm not sure if it's intentional. @nodejs/repl @BridgeAR wdyt? |
@meixg since you committed there in the past and it doesn't look like a hard fix, want to take a look at this too? |
Yes, with pleasure :) |
I made a PR may fix this: #42053 But there may be two more things we can improve:
|
Thanks for working on this, @meixg . But I want to clarify that the issue I raise here is not related to "preview" (the advance evaluation of the line I'm still typing), but rather "autocomplete", particularly preferring it's own suggestion without confirmation from me. I like autocomplete, when it doesn't get in my way. Preview, however, is... uncompelling. |
I know what you mean, see 80913e6, when you press With the PR above, it will behave more like the Chrome DevTools console. |
I agree Chrome Devtools has a good usability model to emulate. I'll give this observation, then leave it in your capable hands: In Devtools, when I'm at the point of having an outstanding suggestion, my first ENTER accepts the suggestion, and a second ENTER submits the line. In Node REPL, a single ENTER does both of these. |
Yeah, there is a different behavior too, I can try to improve that. |
Fix: #42040 PR-URL: #42053 Fixes: #42040 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Fix: nodejs#42040 PR-URL: nodejs#42053 Fixes: nodejs#42040 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Fix: #42040 PR-URL: #42053 Fixes: #42040 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Fix: #42040 PR-URL: #42053 Fixes: #42040 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Fix: #42040 PR-URL: #42053 Fixes: #42040 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Fix: #42040 PR-URL: #42053 Fixes: #42040 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Version
v16.13.0
Platform
Microsoft Windows NT 10.0.19044.0 x64
Subsystem
repl
What steps will reproduce the bug?
When typing into the REPL, autocomplete often predicts identifiers or keywords even when the typed characters are valid. When I hit ENTER (no TAB to accept), then the REPL chooses to use its prediction rather than what I actually typed.
For example, typing
then hitting ENTER
It's infuriating.
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior?
I expect to be able to hit TAB to accept the prediction. If I continue to type something else then autocomplete should revise its prediction. If I hit enter, autocomplete should realize its services are no longer needed.
What do you see instead?
followed by ENTER results in
Additional information
No response
The text was updated successfully, but these errors were encountered: