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 and JetBrains IDEs, 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.
Some languages are not supported in all JetBrains IDEs, or might require additional plugin support.
For Web IDE, Visual Studio, Neovim, and Eclipse, 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 | Visual Studio 2022 for Windows | Neovim | Eclipse |
|---|---|---|---|---|
| C | ||||
| C++ | ||||
| C# | ||||
| CSS | No | No | No | |
| Go | ||||
| Google SQL | No | |||
| HAML | ||||
| HTML | No | No | No | |
| Java | ||||
| JavaScript | ||||
| Kotlin | No | |||
| Markdown | 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 |
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 and JetBrains IDEs, Code Suggestions is turned on by default for all languages except plain text. You can turn it off for specific languages.
VS Code
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.
JetBrains IDEs
Prerequisites:
- For the status bar option, Code Suggestions is turned on and the GitLab Language Server is running.
To turn Code Suggestions off or on for the language of the current file:
- In your JetBrains IDE, open a file in the language.
- In the status bar, select the GitLab Duo icon.
- Select Disable Code Suggestions for the language to turn it off, or Enable Code Suggestions for the language to turn it back on.
This option is not available for plain text files.
To turn Code Suggestions off or on for any language:
- In your JetBrains IDE, go to Settings > Tools > GitLab Duo.
- Under Languages with Code Suggestions Disabled:
- To turn off a language, select Add Language, then select the language.
- To turn a language back on, select Remove ( ) next to it.
- Select Apply or OK.
If you turned off languages in an earlier version of the plugin, they stay off when you update. If you added languages to the Additional languages setting of an earlier version, they are turned on when you update, even if you also turned them off.
Add support for more languages
In VS Code and JetBrains IDEs, 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 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. ↩︎