
Yes, that is on purpose and a new feature. When the selected suggestion isn't making a textual change Enter inserts a newline, not accepting and doing nothing
Well, the real fix for #15702 is to introduce a neverSuggestFullSuggestion setting. It's not about showing it and ignoring keypresses, it's about not showing it at all.
And #11944 makes sense because it refers to the repl. You said it perfectly:
Surely this isn't a default for the normal text editor
The current behaviour totally goes against common sense UX, it breaks my expectation because all of a sudden there's a state in which Enter does something else than what I expect when the suggest widget is open.
We have discussed this in last weeks standup and came to this. Feel free to bring it up again.
🙌 can't agree more with @joaomoreno.
And it would be great to have a setting for this.
Same here. This seems to be annoying as I always have to DELETE the line-break character to continue typing here and there. For me it's not a feature but a nightmare... There should be a setting or something to disable this.
Could you please reopen this as a feature request (which is providing a setting to choose the behavior)?
This should be reopened. The behaviour might not be good for some people. But it also expectation of previous behaviour some other people (like me) too
In short this is breaking change in behaviour and it should add more setting to control it instead of just silently changed
I was always using enter to accept suggestion. It make me feel natural to close suggestion box with enter by default
And actually people who would go as far as setting acceptSuggestionOnEnter to true would not mind another setting to acceptSuggestionOnFullTextWithEnter
On the other hand people who felt that they got stolen Enter key by suggestion box should not set acceptSuggestionOnEnter to true from the first place
To tell you true. Enter to close suggestion box would making newline is really annoying
@jrieken Seriously you should stop closing all issue of this behaviour
THIS IS SERIOUSLY A BUG AND IT NOT SOLVED FOR MONTH AND YOU JUST CONTINUOUSLY SHOVE IT UNDER THE RUG
@joaomoreno The problem is sometimes we have many words that start with the same word
C#
var a = "";
var a0 = "0";
Should we just close suggestion box for a because it actually is complete word or not?
Yes, we close all duplicates of this issue to have one central place for a mature and insightful discussion. I don't think having one place for a discussion is a bad thing.
@Thaina You (as everyone else) is invited to join this discussion. We constantly look at feedback and make our decisions based on that. Indeed that's the reason we made this change in the first place. So far around 5 people have complained about this change, some more and some less emotional.
Again: The motivation for this change is that 24x7 IntelliSense aggressively shows and that users complained about Enter being 'stolen'. Therefore we made a change that 'Enter' inserts a new line when: (1) suggestions have been triggered just by typing (not manual IntelliSense (ctrl+space), not by a trigger character) and (2) when the suggestion doesn't change text already typed (is not a snippet, has no command nor additional text edits). We think it was defensive enough. Also, this is just a keybinding configuration which can be changed.
Next steps:
To re-store the old enter behaviour add this to your keybindings.json
{
"key": "enter",
"command": "acceptSelectedSuggestion",
"when": "editorTextFocus && suggestWidgetVisible"
}
@jrieken If you decide that this issue would be a place to track but you don't open it then everyone who got this problem will come and cannot find open issue about their problem so they would create new duplicate issue again and again
And it was the evidence that you really shove it under the rug by keep mentioning the closed issue while closing the newer reported issue. I got emotional not because the changed but because this behaviour
Reopening to collect feedback on the workaround below:
To re-store the old enter behaviour add this to your keybindings.json
{
"key": "enter",
"command": "acceptSelectedSuggestion",
"when": "editorTextFocus && suggestWidgetVisible"
}
@Thaina @songtm @seancheung @neilsustc Can you verify that above keybindings-customization does restore the previous enter-behaviour?
I try it for 1 minute with it and seem like that keybinding work
Aside from this problem I actually want to report it for so long that suggestion box stole my tab key
I use tab as another kind of space since Windows7 but then vscode from v1 stole it from me
But I just accept that people like it and make keybinding for myself. I was not look in that way before
Until you say that people who use enter to newline felt that enter key was stolen from them
If you think that we should satisfied by keybinding fix like this. I would like to have tab not be a default accept key too and people should also fix it by keybinding
That works for me thx !
It works for me too. 👍
But, IMHO, the behavior in old version makes more sense in UX. Introducing newline if there won't be textual change is a good feature, but not a commonly seen default behavior.
So I'd like to vote for a neverSuggestFullSuggestion setting and default to false.
To elaborate what I said about UX, the problem is that although I know the rule which is to check if there is textual change, there is no visual difference when the suggest widget will or will not 'eat' your Enter key. So at present, every time I find I have already typed all the letters, I have to stop and be careful so that I won't get an unexpected line break.
Comparing to getting an unexpected newline, I'd rather to press Enter one more time.
We can have a easy solution which is making suggest widget semi-transparent when there won't be textual change (and a tooltip like "press Enter to insert a newline").
I think it's a 'beautiful' solution, but it will need additional work and is not necessary if we can have a setting mentioned above.
I'd like to give a +1 vote to reverting back to the previous behavior. To insert a new line on accepting an autocomplete suggestion is an odd default behavior in my opinion. Maybe as a Shift+Enter behavior, but please don't hijack the default.
I will enrich the "editor.acceptSuggestionOnEnter": true setting from true or false to some tri-state.
The editor.acceptSuggestionOnEnter-setting now accepts on, off and smart. The default is on, fyi @isidorn for the latter and the debug console.
@jrieken The default seems to be smart right now in source.
@joaomoreno Not so sure about that: https://github.com/Microsoft/vscode/commit/2b7051efd815ac0afb9b1e7ba021760c8a306fc3
@jrieken thanks for the heads up
I hadn't pulled. 🤦♂️
Will this change go to may update? As this is really desperately annoying.
@regs01 As the milestone says, yes. It will be released tomorrow.
Most helpful comment
The
editor.acceptSuggestionOnEnter-setting now acceptson,offandsmart. The default ison, fyi @isidorn for the latter and the debug console.