Skip to content

GitLab extension for Visual Studio

The GitLab extension integrates GitLab with Visual Studio for Windows. GitLab for Visual Studio supports GitLab Duo Code Suggestions.

This project shows a status icon in the status bar:

The status bar in Visual Studio.

Icon Status Meaning
{tanuki-ai} Ready You've configured and enabled GitLab Duo, and using a language that supports Code Suggestions.
{tanuki-ai-off} Not configured You haven't entered a personal access token, or using a language that Code Suggestions doesn't support.
The status icon for fetching Code Suggestions. Loading suggestion GitLab Duo is fetching Code Suggestions for you.
The status icon for a Code Suggestions error. Error GitLab Duo has encountered an error.

Download the extension

Download the extension from the Visual Studio Marketplace.

The extension requires:

  • Visual Studio 2022, either AMD64 or Arm64.
  • 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.

Configure the extension

After you download and install the extension, you must configure it.

Prerequisites:

To do this:

  1. Install the extension from the Visual Studio Marketplace, and enable it.
  2. In GitLab, create a GitLab personal access token with the api and read_user scopes.
    1. Copy the token. For security reasons, this value is never displayed again, so you must copy this value now.
  3. Open Visual Studio.
    1. On the top bar, go to Tools > Options > GitLab.
    2. For Access Token, paste in your token. The token is not displayed, nor is it accessible to others.
    3. For GitLab URL field, provide the URL of your GitLab instance. For GitLab SaaS, use https://gitlab.com.

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.

Customize keyboard shortcuts

This extension provides these custom commands:

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:

  1. On the top bar, go to Tools > Options.
  2. Go to Environment > Keyboard. Commands exposed by this extension are prefixed with GitLab..
  3. Select a command, and assign it a keyboard shortcut.

Report issues with the extension

Report any issues, bugs, or feature requests in the gitlab-visual-studio-extension issue queue.

Related topics

Troubleshooting

For troubleshooting information, see the extension's troubleshooting page.