Troubleshooting GitHub Copilot keyboard shortcuts in Jetbrains IDEs

Troubleshooting GitHub Copilot keyboard shortcuts in Jetbrains IDEs
Photo by Mikhail Kryshen used under Creative Commons

Over the past months I've delivered 100s of GitHub Copilot workshops. Ranging from 2 hour introduction talks, where I quickly walk through the main features of the product, up to day-long workshops with interactive hands-on.

For most people it's pretty easy to get started. In Visual Studio Code you install a plugin, in Visual Studio 2022 it's installed by default, but in other IDEs it can be a bit trickier to get GitHub Copilot to work.

In my experience the different Jetbrains IDEs are among the trickiest. This includes IntelliJ, Rider, Pycharm, Webstorm, RubyMine and more. So far I've found two main problems that break GitHub Copilot.

Keyboard shortcut is already assigned to another command

The Jetbrains IDEs, for many users, are an alternative IDE which at some point in their career replaced another product. Because of that there are many predefined keymaps available. For example, Rider offers the following:

  • IntelliJ
  • Emacs
  • Resharper
  • Sublime Text
  • Visual Assist
  • Visual Studio
  • Visual Studio 2022
  • Visual Studio Code

Plugins that install themselves in these IDEs need to find a keyboard shortcut which isn't already in use, and among all of these different layouts that leaves very few easily accessible keys available.

You can see whether an assigned keyboard shortcut is conflicting with other assigned commands by double-clicking the command in the keymap and picking Add keyboard shortcut from the context menu.

See whether an assigned keyboard shortcut is conflicting with other assigned commands by double-clicking the command in the keymap and picking Add keyboard shortcut from the context menu

For example, the default alt+\ keyboard shortcut is used by GitHub Copilot to Show Completions, but in the Visual Studio 2022 keymap, which is my preference, that shortcut is already assigned to 3 other commands:

alt+\ is already assigned to 3 other commands

In order to use GitHub Copilot to its fullest potential, you need to go through each of its keyboard shortcuts and either assign a free key combination or remove the other assigned actions by clicking ok and then choosing to remove the other assigned actions:

Remove other assigned actions to allow GitHub Copilot to use the keyboard shortcut

For now, I haven't found a better solution. On the plus side, this will allow me to assign the same keyboard shortcuts I use in Visual Studio 2022 or Visual Studio Code so that I don't need to juggle even more shortcuts in my head.

Conflict between GitHub Copilot and Jetbrains' bundled line completion

Completing a suggestion using tab might not work when GitHub Copilot and Jetbrains' bundled Full line code completion are enabled at the same time. Work is clearly underway to let these two coexist and work together.

Yet I've encountered issues when GitHub Copilot and Jetbrains' Inline completion are both turned on. Under normal circumstances the two features work it out among eachother, but when connecting to a remote IDE using ssh (using GitHub Codespaces for example) the assigned keyboard shortcuts may fail.

This is either fixed by ensuring GitHub Copilot and Full line code completion are both installed locally as well as remotely and are both up to date. In case tab completion still fails, disabling the Full line code completion plugin both locally and remotely usually solves the problem.

Disable the "Full line completion" plugin in case GitHub Copilot can't tab complete.