TL;DR the tab key should insert first suggestion, but then cycle through suggestions, replacing the last completion.
Sublime autocompletion can be configured so that when pressing the tab multiple times it will cycle through the autocompletions by inserting the first suggestion (closing the suggestion box), then replacing the suggestion by succeeding ones when pressing tab repeatedly.
Problem description:
Visually:
// e.g. 1. typing`whatI` will render both options in suggestion box
whatI|
-whatIGet // => 2. first option will be autocompleted on `tab` closing the suggestion box
-whatIWant // => 3. on second `tab` this should replace the first (wrong) suggestion
function whatIWant() {}
funciton whatIGet() {}
Textually:
Currently the corresponding controllers don't seem to support this, as accepting the current suggestion to my understanding will clear the suggestion list.
https://github.com/Microsoft/vscode/blob/3215f19074d49e32d5ab55203923865910d4d5ca/src/vs/editor/contrib/suggest/browser/suggestController.ts
https://github.com/Microsoft/vscode/blob/794b435b27bcf4a92cc0a6345b97821e3c827dcc/src/vs/editor/contrib/suggest/browser/suggestWidget.ts
How are people getting around having to press arrow-down and arrow-up :man_facepalming:? I somehow never get the correct suggestion at the top and I quite frankly don't have the most flexible pinky 😢
- tab to complete wrong suggestion
- Suggestions-popup disappears
Yeah, but why close popup on tab?
If your _correct_ suggestion isn't next in the list, and popup is closed you can run into a situation when you rapidly pressed tab key and gone too far in your list, then you could use ↑ to go up, but there is no popup so you wil probably change line.
Yes, I know that you can use shift+tab to go backwards in the list, but I think it is better to see list, because it is changing all the time, and you dont need to remember how far your suggestion is.
Well maybe someone dont like the fact that when completion is done, no matter wrong or right one, the list is still there and hovers above the code, hiding it from eyesight, and closing popup after first tab is good for them, but there are other people like me who like the opposite behavior, when the popup is always open until you close it by typing. So there may be an extra option for popup behavior
A nice GIF showing what we can do in Sublime
https://stackoverflow.com/questions/48883721/cycle-to-previous-suggestions-in-vscode
This isn't exactly a duplicate of #34694, supertab in vim keeps the popup open, and doesn't pop up until you hit tab.

Code completion the way VSCode handles it is really disruptive and slower than just typing out what I want :\
@ryanflorence well, the main idea of any modern autocompletion system is fuzziness. Thats is, you don't need to scroll through list most of the time. Let me demonstrate this:

At first I typed sii wich gave me some_function_with_name_that_is_not_shorter()
And then I type sul and got some_function__that_has_unnecessary_long_name()
However it is not always possible to match with fuzzy, like here:

_(Imagine that I need that int variable)_
and therefore I likely need to spam a tab key some times (I actually use vim with deoplete, so I can), but again, usually I don't, because like here, it is faster to hit c twice.
BTW not regarding to topic, why supertab? It's not nearly as good as standard vim completion system, and far behind other async plugins like deoplete or neovim-completion-manager, or even that bloated YCM
@andreyorst fuzzy searches are not orthogonal to cycling and I'm quite sure everyone here understands how fuzzy searches work
you fuzzy-search when you know the symbol you're looking for (or have a strong suspicion) but don't want to write it all out yourself
you cycle when you want to explore your options
this issue isn't about fuzzy-searches however, it is about triggering autocomp and cycling, so let's stay ontopic
so let's stay ontopic
ok, you want cycling. I'm not against cycling either. Let me explain myself. I'm against programmers who cycle around after every keypress, browsing kilometers of completion items, just to get single one, wich they even know about, but just because it's so fun to cycle around they will do it. In most cases you need to press one extra key (rarely two) to fuzzy match through hell lot of items in the list, but they will hold Tab and wait until chooser will reach their desired completion item. Thats why vscode completion system is good. It disciplines programmer to use his brain instead of brute force. It is hard to figure out how much more productive you will be if you will not scroll every time, and fuzzy match through.
However cycling may benefit in some cases, when you have to deal with messed codebase, with large classes with tons of fields and methods, and you just want to examine it. The problem is only the fact that arrows used for that.
fyi - I have an implementation this in https://github.com/Microsoft/vscode/pull/58871. It will be behind a setting and disabled by default. Now a remaining question: How should this be called? A need a good name for the setting. Anyone having ideas? @DomiR how does sublime call this?

This is how it works
tab@jrieken amazing work!
😍 this is perfection. I loved this feature in Sublime and it would be great to get this into VSCode. You are the best, thank you so much!
They call it "tab_completion", see here: https://www.sublimetext.com/docs/2/tab_completion.html
Hm, we have editor.tabCompletion but that currently on expands snippets and only when the cursor is after a snippet prefix. We can extend that option to be off | onlySnippets | on where todays true maps onto onlySnippets.
This is now in master and will be in tomorrows Insiders build: http://code.visualstudio.com/insiders/!
Try it and let me know what you think. This is how it works
editor.tabCompletion setting has now new values off (was false), onlySnippets (was true), and on for the full tab completion behaviour on it will expand a prefix (when the suggest widget isn't showing)on and no suggestion could be found it will insert \ton it will cycle through other suggestions given the current suggestion has been accepted via tab or was tab-completed@jrieken What can I say... It's the best feature, I'm in heaven 😄
I'm using these settings and it feels amazing, no more annoying suggestions popup and I can easily autocomplete my changes by pressing tab.
"editor.quickSuggestions": false,
"editor.suggestOnTriggerCharacters": false,
"editor.tabCompletion": "on",
"emmet.triggerExpansionOnTab": true,
You did a really great job because it surpassed my expectations, it works perfectly!!! ❤️
Thanks for the nice feedback!
since the conversation is happening here, I thought of combining my feedback
@jrieken although the current feature in the Insiders is better than before, I was looking for something a bit different that is implemented in Xcode.
See how tab keeps the IntelliSense open, as well as keeps highlighting matched elements.

Is there going to be a when clause context that can detect when the suggestions are in this cycle mode? I am the author of an extension where the tab key reformats enclosing code and that makes this new feature unavailable for my users if they keep the key binding.
Maybe @jrieken knows the answer to my question?
I found some contexts in the keybindings for the feature. hasOtherSuggestions, and config.editor.tabCompletion. Couldn't find a way to check if (tabCompletion was off OR no more suggestions available), but I got it reasonably right by just checking for the latter.
Guys, this issue was closed, if you want to ask a feature request or something like that, please open a new issue.
Most helpful comment
This is how it works
tab