Sworld

Sworld

The only way to do great work is to love what you do.

Resolve Github Copilot completion conflicts

Recently, while using Github Copilot, I found that when facing NES (Next Edit Suggestions) completions, pressing the Tab key often results in spaces being inserted instead of jumping to the target position. After some investigation, I discovered that this is due to a conflict with the Tab key binding in VSCode. This article documents the solution.

Error Manifestation#

When using Github Copilot for code completion, pressing the Tab key does not jump to the completion suggestion but instead inserts spaces, making it impossible to accept the completion suggestions smoothly, as shown in the image below:

Prompt generated
Spaces generated after Tab

Debugging Approach#

First, we enable the keyboard shortcut debugging feature in VSCode by pressing Ctrl + Shift + P and searching for shortcut troubleshooting to open the shortcut debugging panel.

check1

We find information similar to the one below:

check2

2025-10-18 15:58:06.749 [info] [Window] [KeybindingService]: / Received keydown event - modifiers: [], code: Tab, keyCode: 9, key: Tab
2025-10-18 15:58:06.749 [info] [Window] [KeybindingService]: | Converted keydown event - modifiers: [], code: Tab, keyCode: 2 ('Tab')
2025-10-18 15:58:06.749 [info] [Window] [KeybindingService]: | Resolving Tab
2025-10-18 15:58:06.749 [info] [Window] [KeybindingService]: \ From 14 keybinding entries, matched tabout, when: editorTextFocus && !editorHasMultipleSelections && !inSnippetMode && !inlineSuggestionVisible && !suggestWidgetVisible, source: user extension albert.TabOut.
2025-10-18 15:58:06.749 [info] [Window] [KeybindingService]: + Invoking command tabout.

Clearly, the Tab key is occupied by the TabOut plugin.

Solution#

At this point, we can use Ctrl + K Ctrl + S to open the keyboard shortcut settings, search for "Tab", find TabOut: Tab Out, and click the trash can icon on the right to delete that key binding.

However, there is a better way, which is to set a condition for the TabOut plugin so that it does not take effect when Github Copilot completion suggestions appear. We can append the !inlineEditIsVisible condition to the end of its when condition, resulting in the final condition editorTextFocus && !editorHasMultipleSelections && !inSnippetMode && !inlineSuggestionVisible && !suggestWidgetVisible && !inlineEditIsVisible (press Enter to save after editing).

Now, completion works normally:

example3

example4

After finishing, press Ctrl + Shift + P again to search for shortcut troubleshooting to close the shortcut debugging panel.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.