This is the GitLab extension for Visual Studio (Community, Pro, and Enterprise).
It is not the extension for Visual Studio Code.
Minimum supported version
The GitLab for Visual Studio extension supports Code Suggestions for both
GitLab SaaS and
GitLab self-managed.
Requirements:
- Visual Studio 2022.
- GitLab version 16.1 and later.
- GitLab Duo Code Suggestions requires GitLab version 16.8 or later.
Visual Studio for Mac is not supported.
Setup
Prerequisites:
- You must be using GitLab Enterprise Edition.
- For self-managed installations, Code Suggestions must be
enabled for your instance.
- For GitLab.com, Code Suggestions must be
enabled for your top-level group. See instructions
for SaaS.
- Install the extension from the Visual Studio Marketplace and enable it.
- In GitLab, create a GitLab Personal Access Token with the
api
and read_user
scopes:
- Copy the token. For security reasons, this value is never displayed again, so you must copy this value now.
- Open 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 field, provide the URL of your GitLab instance. For GitLab SaaS, use
https://gitlab.com
.
Features
Code Suggestions
Write code more efficiently by using generative AI to suggest code while you’re developing. To learn more about this feature, see the
Code Suggestions documentation
Code Suggestions is a generative artificial intelligence (AI) model.
To learn more, see the GitLab documentation for
Code Suggestions.
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
Users should read about the known limitations
Supported Languages
- C++
- C#
- Go
- Google SQL
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Rust
- Scala
- Swift
- TypeScript
Usage
Tab
accepts suggestion
Escape
dismisses suggestion
Status Bar
A status icon is displayed in the status bar. It provides the following:
- A button that can quickly disable/enable code suggestions.
- Display a code suggestion in progress icon.
- Display an error icon and provide an error message as tooltip.
- Before the extension has been configured, the error icon is shown with a message about configuration.
![status_bar_visual_studio.png](https://gitlab.com/gitlab-org/editor-extensions/gitlab-visual-studio-extension/-/raw/main/docs/assets/status_bar_visual_studio.png)
Commands
The extension registers custom commands with the Visual Studio IDE. These commands
can be accessed with keyboard shortcuts, which you can personalize:
- 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.
These commands are available:
Command name |
Default keyboard shortcut |
Feature |
GitLab.ToggleCodeSuggestions |
N/A |
Enable or disable automated code suggestions. |
Roadmap
To learn more about this project's team, processes, and plans, see
the Create:Editor Extensions Group
page in the GitLab handbook.
For a list of all open issues in this project, see the
issues page
for this project.
Troubleshooting
See the troubleshooting documentation.
Report issues in the
feedback issue.
Feedback
We'd love to hear from you. If you've found a bug, or have an idea,
open an issue.
Contributing
This extension is open source and hosted on GitLab. Contributions are more than welcome and subject to the terms set forth in CONTRIBUTING. Feel free to fork and add new features or submit bug reports. See CONTRIBUTING for more information.