Supported extensions and languages

Tier: Premium with GitLab Duo Pro or Ultimate with GitLab Duo Pro or Enterprise Offering: GitLab.com, Self-managed, GitLab Dedicated

Code suggestions are 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 Workflow 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

A GitLab Language Server is used in VS Code, Visual Studio, 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

Code suggestions are aware of common popular programming languages, concepts, and infrastructure-as-code interfaces, like Kubernetes Resource Model (KRM), Google Cloud CLI, and Terraform.

Code suggestions support these languages:

Language Web IDE VS Code JetBrains IDEs Visual Studio 2022 for Windows Neovim
C Yes Yes No Yes Yes
C++ Yes Yes Yes Yes Yes
C# Yes Yes Yes Yes Yes
CSS Yes No No No No
Go Yes Yes Yes Yes Yes
Google SQL Yes Yes Yes Yes Yes
HAML Yes Yes Yes Yes Yes
HTML Yes No No No No
Java Yes Yes Yes Yes Yes
JavaScript Yes Yes Yes Yes Yes
Kotlin No Yes

(Requires third-party extension providing Kotlin support)
Yes Yes Yes
Markdown Yes No No No No
PHP Yes Yes Yes Yes Yes
Python Yes Yes Yes Yes Yes
Ruby Yes Yes Yes Yes Yes
Rust Yes Yes Yes Yes Yes
Scala No Yes

(Requires third-party extension providing Scala support)
Yes Yes Yes
Shell scripts (bash only) Yes No Yes Yes Yes
Svelte Yes Yes Yes Yes Yes
Swift Yes Yes Yes Yes Yes
TypeScript Yes Yes Yes Yes Yes
Terraform No Yes

(Requires third-party extension providing Terraform support)
Yes No Yes

(Requires third-party extension providing the terraform file type)
Vue Yes Yes Yes Yes Yes
note
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.

Locally, you can add more languages. For languages not listed in the table, code suggestions might not function as expected.

Manage languages for code suggestions

History
  • Introduced in GitLab Workflow for VS Code 4.21.0

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:

  1. In VS Code, open the extension settings for GitLab Workflow:
    1. On the top bar, go to Code > Settings > Extensions.
    2. Search for GitLab Workflow in the list, and select Manage ().
    3. Select Extension Settings.
  2. In your User settings, find the section titled AI Assisted Code Suggestions: Enabled Supported Languages.
  3. You will see a list of all supported languages with checkboxes next to each language.
  4. To enable code suggestions for a language, ensure its checkbox is checked.
  5. To disable code suggestions for a language, uncheck its checkbox.
  6. Your changes are automatically saved and will take effect immediately.

When you disable code suggestions for a language, the Duo icon changes to show that suggestions are disabled for this language. On hover, it shows Code Suggestions are disabled 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.

Prerequisites:

To do this:

  1. Find your desired language in the list of language identifiers for VS Code. You need the Identifier for a later step.
  2. In VS Code, open the extension settings for GitLab Workflow:
    1. On the top bar, go to Code > Settings > Extensions.
    2. Search for GitLab Workflow in the list, and select Manage ().
    3. Select Extension Settings.
    4. In your User settings, find GitLab › Ai Assisted Code Suggestions: Additional Languages and select Add Item.
  3. In Item, add the language identifier, and select OK.

View multiple code suggestions

History

For a code completion suggestion in VS Code, multiple suggestion options might be available. To view all available suggestions:

  1. Hover over the code completion suggestion.
  2. Scroll through the alternatives. Either:
    • Use keyboard shortcuts:
      • On a Mac, press Option + ] to view the next suggestion, and Option + [ to view the previous suggestions.
      • On Windows, press Alt + ] to view the next suggestion, and Alt + [ to view the previous suggestions.
    • On the dialog that’s displayed, select the right or left arrow to see next or previous options.
  3. Press Tab to apply the suggestion you prefer.