Search code examples
macosvisual-studio-codegithub-copilot

Using tab in GitHub Copilot doesn't trigger the inline suggestion - macOS Visual Studio Code


I am a new user of GitHub Copilot and I am having trouble triggering the in-line suggestions it provides. I have tried various settings and configurations, but I am still unable to get it to work properly.

The expected output is that I should be able to accept copilot inline suggestions by pressing tab, enter, or space.

I have taken several steps to try and resolve the issue.

  1. I made sure that I am using the most recent version of Visual Studio Code, which is currently 1.78.2.
  2. I ensured that my machine is updated to Mac Air M1 13.3.1.
  3. I installed the latest version of GitHub Copilot, which is currently v1.86.82.

I have also checked and updated my VS Code settings to include the following:

"[copilotignore]": {
    "editor.acceptSuggestionOnCommitCharacter": true,
    "editor.acceptSuggestionOnEnter": "smart"
  },

  "github.copilot.advanced": {
    // "secret_key": "",
    "useTab": true
  },
  "github.copilot.editor.enableAutoCompletions": true,
  "emmet.showSuggestionsAsSnippets": true,
  "github.copilot.enable": {
    "*": true,
    "plaintext": true,
    "markdown": true,
    "scminput": true,
    "javascript": true
  },
  "editor.acceptSuggestionOnEnter": "smart",
  "extensions.autoCheckUpdates": true,

Any ideas what's going on here? enter image description here


Solution

  • The problem may be due to GitHub copilot competing with some other keybindings for use of the tab key. You can try to figure out what that conflict is by looking at the keyboard shortcut UI and searching for the tab key (use the "Record Keys" button), or follow the keybinding troubleshooting steps, or if you suspect another extension, do an extension bisect. Otherwise, you can try changing the GitHub copilot acceptance command to different keys without conflict issues.

    Though looking at the current-ish (v1.121.454) extension manifest for the Copilot extension at the time of this writing, I don't see what keybinding could be interfering. The keybindings I see that take effect when the editor has focus are:

    {                       
        "command": "github.copilot.generate",
        "key": "ctrl+enter",
        "mac": "ctrl+enter",
        "when": "editorTextFocus && github.copilot.activated && !inInteractiveInput && !interactiveEditorFocused"
    },
    {                   
        "command": "editor.action.inlineSuggest.trigger",
        "key": "alt+\\",
        "when": "editorTextFocus && !editorHasSelection && config.github.copilot.inlineSuggest.enable && !inlineSuggestionsVisible"
    }
    

    Also, by v1.121.454, there is no longer a useTab property in the github.copilot.advanced setting.