Code Suggestions on GitLab SaaS
DETAILS: Tier: Free, Premium, Ultimate Offering: SaaS
- 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.
- Generally available in GitLab 16.7.
Get started using Code Suggestions in your IDE. These instructions apply to users of GitLab SaaS.
Prerequisites:
- You must be using one of the supported IDE extensions.
- Code Suggestions must be enabled for the top-level group.
To use Code Suggestions:
-
Author your code. As you type, suggestions are displayed. Code Suggestions provide code snippets or completes the current line, depending on the cursor position.
-
Describe the requirements in natural language. Code Suggestions generates functions and code snippets based on the context provided.
-
To accept a suggestion, press Tab. To reject a suggestion, press Esc.
-
To ignore a suggestion, keep typing as you usually would.
Best practices
To get the best results from code generation:
- Be as specific as possible while remaining concise.
- State the outcome you want to generate (for example, a function) and provide details on what you want to achieve.
- Add additional information, like the framework or library you want to use.
- Add a space or new line after each comment. This space tells the code generator that you have completed your instructions.
For example, to create a Python web service with some specific requirements, you might write something like:
# Create a web service using Tornado that allows a user to log in, run a security scan, and review the scan results.
# Each action (log in, run a scan, and review results) should be its own resource in the web service
...
AI is non-deterministic, so you may not get the same suggestion every time with the same input. To generate quality code, write clear, descriptive, specific tasks.
Enable Code Suggestions
- Introduced in GitLab 15.11.
- Moved from GitLab Ultimate to GitLab Premium in 16.0.
- Moved from GitLab Premium to GitLab Free in 16.0.
Code Suggestions are enabled by default at the group level. This setting cascades to all subgroups and projects in the group.
To update this setting:
- On the left sidebar, select Search or go to and find your group.
- Select Settings > General.
- Expand Permissions and group features.
- Under Code Suggestions, select the Projects in this group can use Code Suggestions checkbox.
- Select Save changes.
If you have issues enabling Code Suggestions, view the troubleshooting guide.
Disable Code Suggestions for an individual user
To disable Code Suggestions, you can disable the feature in your IDE editor extension.