Install and set up the GitLab extension for Visual Studio
Download the extension from the Visual Studio Marketplace and install it.
The extension requires:
- Visual Studio 2022, either AMD64 or Arm64.
- The IntelliCode component for Visual Studio.
- GitLab version 16.1 and later.
- GitLab Duo Code Suggestions requires GitLab version 16.8 or later.
- You are not using Visual Studio for Mac, as it is unsupported.
No new additional data is collected to enable this feature. Private non-public GitLab customer data is not used as training data. Learn more about Google Vertex AI Codey APIs Data Governance.
Connect to GitLab
After you download and install the extension, connect it to your GitLab account.
Create a personal access token
If you are on a self-managed GitLab instance, create a personal access token.
- On the left sidebar, select your avatar.
- Select Edit profile.
- On the left sidebar, select Access tokens.
- Select Add new token.
- Enter a name, description, and expiration date.
- Select the
api
andread_user
scope. - Select Create personal access token.
Authenticate with GitLab
Then authenticate with GitLab.
- In Visual Studio, on the top bar, go to Tools > Options > GitLab.
- In the Access Token field, paste in your token. The token is not displayed, nor is it accessible to others.
- In the GitLab URL text box, enter the URL of your GitLab instance. For GitLab.com, use
https://gitlab.com
.
Configure the extension
This extension provides these custom commands, which you can configure:
Command name | Default keyboard shortcut | Feature |
---|---|---|
GitLab.ToggleCodeSuggestions
| not applicable | Enable or disable automated Code Suggestions. |
You can access the extension’s custom commands with keyboard shortcuts, which you can customize:
- On the top bar, go to Tools > Options.
- Go to Environment > Keyboard. Commands exposed by this extension are prefixed with
GitLab.
. - Select a command, and assign it a keyboard shortcut.