'Cycle to previous suggestions in VSCode

enter image description here

Hi, is there a way in Visual Studio Code to cycle to suggested keywords even when you already selected one of them (by clicking TAB multiple times)? This is possible in Sublime. In VSCode even with the keybindings of Sublime it does not work.

In the GIF above, in order to cycle through keywords, I pressed TAB several times, after typing 'hel' and 'he'



Solution 1:[1]

For those still looking for this capability, it was implemented here. Set

"editor.tabCompletion": "on"

in your settings.json, or change the Editor: Tab Completions setting in the UI to enable it.

Solution 2:[2]

I think it is not possible to achieve this exact behavior out of the box. Even the Sublime Text Keymap does not support this. Maybe you want to open a new issue?
A possible workaround to achieve something similar could be to add custom keybindings. To enable toggling the suggestions via Tab and Shift + Tab you can add the following to your keybindings.json:

{
    "key": "tab",
    "command": "selectNextSuggestion",
    "when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
},
{
    "key": "shift+tab",
    "command": "selectPrevSuggestion",
    "when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
}

Update

Maybe macros can solve this. This enables you to chain multiple vscode commands into a single command. Then you can bind this new command to Tab.

Solution 3:[3]

We can use user keybindings to navigate up and down in suggestions available.

There are two default key bindings selectPrevSuggestion and selectNextSuggestion in vscode which can be used to move up and down in the suggestions list.

First, we have to got to show default key bindings from settings and here, we can change selectPrevSuggestion and selectNextSuggestion easily as our wish.

In below screenshot we can see that enter image description here

For selectPrevSuggestion it is upArrow by default which can be changed by clicking on it easily to our wish.

Similary, we can change for selectNextSuggestion.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jackson S
Solution 2
Solution 3 Mayank Kumar Thakur