Code Suggestions on GitLab SaaS
Version history
- Introduced in GitLab 15.9 as Beta for early access Ultimate customers on GitLab.com.
- Enabled as opt-in with GitLab 15.11 as Beta.
- Moved from GitLab Ultimate to GitLab Premium in 16.0.
- Moved from GitLab Premium to GitLab Free in 16.0.
- Enabled by default in GitLab 16.1.
Write code more efficiently by using generative AI to suggest code while you’re developing.
Usage of GitLab Duo Code Suggestions is governed by the GitLab Testing Agreement. Learn about data usage when using Code Suggestions.
Enable Code Suggestions
Version history
- Introduced in GitLab 16.1 as Beta.
- Enabled on GitLab.com and self-managed in GitLab 16.8. Available to a percentage of users.
A group owner must enable Code Suggestions for your top-level group.
If you are having issues enabling Code Suggestions, view the
troubleshooting guide.
Use Code Suggestions
Prerequisites:
- You must have configured Code Suggestions in a supported IDE editor extension.
- Code Suggestions must be enabled for:
- The top-level group.
- Your own account, if your account is not part of the percentage rollout.
To use Code Suggestions:
- Determine if your user account is part of the percentage rollout. See Enable Code Suggestions for more information.
- Author your code. As you type, suggestions are displayed. Code Suggestions provide code snippets or complete the current line, depending on the cursor position.
- Describe the requirements in natural language. Be concise and specific. Code Suggestions generates functions and code snippets as appropriate.
- To accept a suggestion, press Tab.
- To ignore a suggestion, keep typing as you usually would.
- To explicitly reject a suggestion, press Esc.
Things to remember:
- AI is non-deterministic, so you may not get the same suggestion every time with the same input.
- Just like product requirements, writing clear, descriptive, and specific tasks results in quality generated code.
Disable Code Suggestions
Individual users can disable Code Suggestions by disabling the feature in their installed IDE editor extension.