Conflict between GitHub Copilot and R's extension in vscode

Viewed 191

I can't execute my R code using GitHub's Copilot in Visual Studio Code. The R extension is @ext:ikuyadeu.r

The problem is probably that they use the same command.

r.runSelection: "Ctrl+Enter"

github.copilot.generate: "Ctrl+Enter"

I edited the keybindings.json

{
[
   {
       "key": "ctrl+enter",
       "command": "r.runSelection",
       "when": "editorTextFocus && editorLangId == 'r'"
   },
   {
       "key": "ctrl+p",
       "command": "github.copilot.generate",
       "when": "editorTextFocus && editorLangId == 'python'"
   }
]
}

and settings.json:

    "github.copilot.enable" : {
        "*": false,
        "yaml": false,
        "r": false,
        "plaintext": false,
        "markdown": false,
        "python": true,
        "jsonc": true
    }

But it was not successful.

1 Answers

Ctrl+Enter is probably still active as a keybinding for Copilot. You can disable it by adding this to your keybindings.json. Note the - in front of the command.

   {
       "key": "ctrl+enter",
       "command": "-github.copilot.generate",
       "when": "editorTextFocus && editorLangId == 'python'"
   }
Related