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:

IDEExtension
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 IDEsGitLab Duo Plugin for JetBrains
Neovimgitlab.vim plugin
EclipseGitLab 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.

LanguageWeb IDEVisual Studio 2022 for WindowsNeovimEclipse
Ccheck-smcheck-smcheck-smcheck-sm
C++check-smcheck-smcheck-smcheck-sm
C#check-smcheck-smcheck-smcheck-sm
CSScheck-smNoNoNo
Gocheck-smcheck-smcheck-smcheck-sm
Google SQLcheck-smcheck-smcheck-smNo
HAMLcheck-smcheck-smcheck-smcheck-sm
HTMLcheck-smNoNoNo
Javacheck-smcheck-smcheck-smcheck-sm
JavaScriptcheck-smcheck-smcheck-smcheck-sm
KotlinNocheck-smcheck-smcheck-sm
Markdowncheck-smNoNoNo
PHPcheck-smcheck-smcheck-smcheck-sm
Pythoncheck-smcheck-smcheck-smcheck-sm
Rubycheck-smcheck-smcheck-smcheck-sm
Rustcheck-smcheck-smcheck-smcheck-sm
ScalaNocheck-smcheck-smcheck-sm
Shell scripts (bash only)check-smcheck-smcheck-smcheck-sm
Sveltecheck-smcheck-smcheck-smcheck-sm
Swiftcheck-smcheck-smcheck-smcheck-sm
TypeScript (.ts and .tsx files)check-smcheck-smcheck-smcheck-sm
TerraformNoNocheck-sm 1check-sm
Vuecheck-smcheck-smcheck-smcheck-sm

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:

  1. In VS Code, open a file in the language.
  2. Open the Command Palette:
    • For macOS, press Command+Shift+P.
    • For Windows or Linux, press Control+Shift+P.
  3. 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:

  1. In VS Code, open the Settings editor:
    • For macOS, press Command+,.
    • For Windows or Linux, press Control+,.
  2. Select Extensions > GitLab > GitLab Duo.
  3. Under GitLab › Duo Code Suggestions: Disabled Languages, select Add Item.
  4. Enter the language identifier, like python or markdown.
  5. 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:

  1. In your JetBrains IDE, open a file in the language.
  2. In the status bar, select the GitLab Duo icon.
  3. 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:

  1. In your JetBrains IDE, go to Settings > Tools > GitLab Duo.
  2. 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 ( close ) next to it.
  3. 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:

To do this:

  1. In the Eclipse bottom toolbar, select the GitLab icon.
  2. Select Show Settings.
  3. Scroll down to the Code Suggestions Enabled Languages section.
  4. In Additional Languages, add a comma-separated list of language identifiers. Don’t add leading periods to the identifiers. For example, use html, md, and powershell.

  1. Neovim requires a third-party extension that provides the terraform file type. ↩︎