Use GitHub Copilot | Qt Creator Documentation

- Qt Creator Documentation
- Use GitHub Copilot
- Qt Creator 19.0.1

Switch to Edit mode ◦ Use Qt AI Assistant

# Use GitHub Copilot

The Copilot plugin (disabled by default) integrates GitHub Copilot into Qt Creator. You can view suggestions from Copilot in the Edit mode.

Note: If you enable the Copilot plugin, you must agree with and abide by the GitHub terms of use. It is your responsibility to know and accept the requirements and parameters of using Copilot, such as ensuring you have the rights to grant it access to your code. Also, you must understand the implications of using it and the suggestions it produces, such as code copyright and accuracy.

## Requirements

To use the Copilot plugin, you need:

- An active GitHub Copilot subscription.
- GitHub Copilot Neovim plugin installed (requires Node.js), as described in Copilot.vim/Readme.md.

## Set Copilot preferences

To set preferences for using Copilot:

1. Go to Preferences > AI > Copilot.

2. Select Enable Copilot to use Copilot.
3. 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.

4. In Node.js path, enter the full path to the Node.js executable.
5. In Path to language-server.js, enter the path to `language-server.js` in the Copilot Neovim plugin installation folder.
6. Select Auto request to receive suggestions for the current text cursor position when you make changes.
7. In GitHub Enterprise URL, enter the URL to Copilot server that runs in the enterprise environment.
8. In Proxy, enter the host name and port number of the proxy server to connect to Copilot servers.
9. Select Reject unauthorized to prevent the security risk presented by accepting unauthorized certificates from the proxy server.

## Receive suggestions

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

To manually request a suggestion at the current editor's cursor position, enter t, followed by Space to show Request Copilot Suggestion in the locator.

Hover over a suggestion to show a toolbar with (Previous) and (Next) buttons for cycling between Copilot suggestions.

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

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

To reject a suggestion, select Esc or the arrow keys.

## Turn suggestions on and off

You can turn the Copilot suggestions on and off either globally for all projects or at project level for a particular project.

### Toggle Copilot suggestions

To turn Copilot suggestions on or off globally, select (Toggle Copilot). This also sets the value of Enable Copilot in Preferences > Copilot accordingly.

### Turn suggestions on or off for a project

To turn Copilot suggestions on or off for a particular project:

1. Go to Projects > Project Settings > Copilot.

2. Clear Use global settings.
3. Select or clear Enable Copilot.

See also Enable and disable plugins and Editing code.

Switch to Edit mode ◦ Use Qt AI Assistant