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, 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.

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

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:

  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.

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:

To do this:

  1. Find your desired language in the list of language identifiers. You need the identifier for your languages in a later step.
  2. In your IDE, in the top bar, select your IDE name, then select Settings.
  3. In the left sidebar, select Tools > GitLab Duo.
  4. 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, like html,powershell,latex, and don’t add leading periods to each identifier.
  5. Select OK.

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. ↩︎