Using GitHub Copilot

The experimental Copilot plugin integrates GitHub Copilot into Qt Creator. You can view suggestions from Copilot in the Edit mode.

Requirements

To use the Copilot plugin, you need:

Enabling the Copilot Plugin

To enable the Copilot plugin:

  1. Select Help > About Plugins > Utilities > Copilot to enable the plugin.
  2. Select Restart Now to restart Qt Creator and load the plugin.

Setting Copilot Preferences

To set preferences for using Copilot:

  1. Select Edit > Preferences > Copilot.

    {Copilot tab in Preferences}

  2. Select Sign In to sign into your subscription, activate your device, and authorize the GitHub Copilot plugin.

    The button turns into a Sign Out button.

  3. Select the Enable Copilot check box to use Copilot.
  4. In the Node.js path field, enter the full path to the Node.js executable.
  5. In the Path to agent.js field, enter the path to agent.js in the Copilot Neovim plugin.
  6. Select the Request completions automatically checkbox to receive suggestions for the current text cursor position when you make changes.

Pair-Programming with Copilot

When you write code in the Edit mode and Request completions automatically is enabled, Copilot automatically makes suggestions when you type.

{Receiving suggestions from Copilot in the editor}

To manually request a suggestion at the current editor's cursor position, select Request Copilot Suggestion in the context menu.

Hover the mouse over a suggestion to show a toolbar with and buttons for cycling between Copilot suggestions.

To apply a suggestion as a whole, select Apply or press the Tab key.

To apply a suggestion word-by-word, select Apply Word or press Alt+Right.

Enabling and Disabling Copilot

You can enable and disable the Copilot plugin either globally for all projects or at project level for a particular project.

To enable or disable Copilot suggestions globally, select the (Toggle Copilot) button. This also sets the value of the Enable Copilot check box in Edit > Preferences accordingly.

To enable or disable Copilot suggestions for a particular project, select Projects > Project Settings > Copilot, and then select or deselect the Enable Copilot check box.