Supported extensions and languages
Code Suggestions is available in the following editor extensions and for the following languages.
Supported editor extensions
To use Code Suggestions, use one of these editor extensions:
| IDE | Extension |
|---|---|
| Visual Studio Code (VS Code) | GitLab for VS Code |
| GitLab Web IDE (VS Code in the Cloud) | No configuration required. |
| Microsoft Visual Studio (2022 for Windows) | Visual Studio GitLab extension |
| JetBrains IDEs | GitLab Duo Plugin for JetBrains |
| Neovim | gitlab.vim plugin |
| Eclipse | GitLab for Eclipse |
A GitLab Language Server is used in VS Code, Visual Studio, Eclipse, and Neovim. The Language Server supports faster iteration across more platforms. You can also configure it to support Code Suggestions in IDEs where GitLab doesn’t provide official support.
You can express interest in other IDE extension support in this issue.
Supported languages by IDE
The following table provides more information on the languages Code Suggestions supports by default, and the IDEs.
Code Suggestions also works with other languages, but you must manually add support.
| Language | Web IDE | VS Code | JetBrains IDEs | Visual Studio 2022 for Windows | Neovim | Eclipse |
|---|---|---|---|---|---|---|
| C | No | |||||
| C++ | ||||||
| C# | ||||||
| CSS | No | No | No | No | No | |
| Go | ||||||
| Google SQL | No | |||||
| HAML | ||||||
| HTML | No | No | No | No | No | |
| Java | ||||||
| JavaScript | ||||||
| Kotlin | No | 1 | ||||
| Markdown | No | No | No | No | No | |
| PHP | ||||||
| Python | ||||||
| Ruby | ||||||
| Rust | ||||||
| Scala | No | 2 | ||||
Shell scripts (bash only) | No | |||||
| Svelte | ||||||
| Swift | ||||||
TypeScript (.ts and .tsx files) | ||||||
| Terraform | No | 3 | No | 4 | ||
| Vue |
Footnotes:
- VS Code requires a third-party extension that provides Kotlin support.
- VS Code requires a third-party extension that provides Scala support.
- VS Code requires a third-party extension that provides Terraform support.
- Neovim requires a third-party extension that provides the
terraformfile type.
Some languages are not supported in all JetBrains IDEs, or might require additional plugin support. Refer to the JetBrains documentation for specifics on your IDE.
Support for Infrastructure-as-Code (IaC)
Code Suggestions works with infrastructure-as-code interfaces, including:
- Kubernetes Resource Model (KRM)
- Google Cloud CLI
- Terraform
Manage languages for Code Suggestions
You can customize your coding experience in VS Code by enabling or disabling Code Suggestions for specific supported languages.
You can do this by editing your settings.json file directly, or from the VS Code user interface:
- In VS Code, open the Settings editor:
- For macOS, press Command+,.
- For Windows or Linux, press Control+,.
- Select Extensions > GitLab > GitLab Duo.
- Find the GitLab › Duo Code Suggestions: Enabled Supported Languages section.
- Select the languages you want to suggest or generate code for.
- Your changes save automatically and take effect immediately.
When you turn off Code Suggestions for a language, the GitLab Duo icon changes to show that suggestions are not available for this language.
Add support for more languages
If your desired language doesn’t have Code Suggestions available by default, you can add support for your language locally. However, Code Suggestions might not function as expected.
Prerequisites:
- You have installed and enabled the GitLab for VS Code extension.
- You have completed the VS Code extension setup instructions, and authorized the extension to access your GitLab account.
To do this:
- Find your desired language in the list of language identifiers. You need the Identifier for your languages in a later step.
- In VS Code, open the Settings editor:
- For macOS, press Command+,.
- For Windows or Linux, press Control+,.
- Select Extensions > GitLab > GitLab Duo.
- Under GitLab › Duo Code Suggestions: Additional Languages, select Add Item.
- Enter the identifier for each language you want to support. Identifiers should be
lowercase, like
htmlorpowershell. Don’t add leading periods from file suffixes to each identifier. - Select OK.
Prerequisites:
- You have installed and enabled the GitLab Duo plugin for JetBrains IDEs.
- You have completed the Jetbrains extension setup instructions, and authorized the extension to access your GitLab account.
To do this:
- Find your desired language in the list of language identifiers. You need the identifier for your languages in a later step.
- In your IDE, in the top bar, select your IDE name, then select Settings.
- In the left sidebar, select Tools > GitLab Duo.
- Under Code Suggestions Enabled Languages > Additional languages, add the identifier for each language
you want to support. Identifiers should be in lowercase, like
html. Separate multiple identifiers with commas, likehtml,powershell,latex, and don’t add leading periods to each identifier. - Select OK.
Prerequisites:
- You have installed and enabled the GitLab for Eclipse plugin.
- You have completed the Eclipse setup instructions, and authorized the extension to access your GitLab account.
To do this:
- In the Eclipse bottom toolbar, select the GitLab icon.
- Select Show Settings.
- Scroll down to the Code Suggestions Enabled Languages section.
- In Additional Languages, add a comma-separated list of language identifiers. Don’t
add leading periods to the identifiers. For example, use
html,md, andpowershell.