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, JetBrains IDEs, 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
In VS Code, Code Suggestions works with all languages that the IDE supports, except plain text. For some languages, like Kotlin, Scala, or Terraform, you must install a third-party extension to add support for the language to VS Code. You can turn off Code Suggestions for specific languages.
For the other IDEs, the following table lists the languages Code Suggestions supports by default. Code Suggestions also works with other languages, but you must manually add support.
| Language | Web IDE | JetBrains IDEs | Visual Studio 2022 for Windows | Neovim | Eclipse |
|---|---|---|---|---|---|
| C | No | ||||
| C++ | |||||
| C# | |||||
| CSS | No | No | No | No | |
| Go | |||||
| Google SQL | No | ||||
| HAML | |||||
| HTML | No | No | No | No | |
| Java | |||||
| JavaScript | |||||
| Kotlin | No | ||||
| Markdown | No | No | No | No | |
| PHP | |||||
| Python | |||||
| Ruby | |||||
| Rust | |||||
| Scala | No | ||||
Shell scripts (bash only) | |||||
| Svelte | |||||
| Swift | |||||
TypeScript (.ts and .tsx files) | |||||
| Terraform | No | No | 1 | ||
| Vue |
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
In VS Code, Code Suggestions is turned on for all languages by default. You can turn it off for specific languages.
To turn Code Suggestions off or on for the language of the current file:
- In VS Code, open a file in the language.
- Open the Command Palette:
- For macOS, press Command+Shift+P.
- For Windows or Linux, press Control+Shift+P.
- Select GitLab: Toggle Code Suggestions for current language.
You can also select the GitLab Duo icon in the status bar, and then select the option to turn Code Suggestions off or on for the current language.
To turn off Code Suggestions for more than one language:
- 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: Disabled Languages, select Add Item.
- Enter the language identifier,
like
pythonormarkdown. - Select OK.
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.
If you turned off languages in the Enabled Supported Languages setting of an earlier version of the extension, it adds them to Disabled Languages when you update.
Add support for more languages
In VS Code, you do not need to add languages. Code Suggestions works with all languages except plain text.
In other IDEs, 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 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.
Neovim requires a third-party extension that provides the
terraformfile type. ↩︎