Use AI in editor
This functionality relies on the AI Assistant plugin that requires an additional license.
For more information about licensing and enabling AI Assistant, refer to JetBrains AI Service licensing and Enable AI Assistant plugin.
Generate code and use inline AI prompts right in the editor.
To generate code in the editor, do one of the following:
Place the caret anywhere in the editor and press Ctrl0\. Write your prompt in the input field and press Enter.
Right-click anywhere in the editor to open the context menu, select AI Actions and then Generate Code. Write your prompt in the input field and press Enter.
Type your prompt right in the editor where you want to make adjustments and press Tab.
Wait for the generation to complete. The generated code will be shown in the same editor tab where you have written your prompt.
All suggested changes are marked with different colors.
If you want to improve the generated code, write a follow-up message with the new requirements in the input field on top of the editor and press Enter.
AI Assistant will regenerate the code while taking into account the new specifications.
If you want to regenerate the answer, click
Regenerate or press CtrlF5.
Click Accept All to insert the generated fragment.
If you want to revert some of the suggested changes, in the gutter, click
Revert.
To discard all the suggested changes, click Discard All.
When you rename (ShiftF6) a symbol, AI Assistant suggests name options for it based on its contents.

This feature is enabled by default. To switch it on and off, check the AI Assistant settings.
Press CtrlAlt0S to open settings and then select Tools | AI Assistant.
Use the Provide AI-generated name suggestions checkbox.
Cloud completion powered by AI Assistant can autocomplete single lines, blocks of code, and even entire functions in real time based on the project context. The generated code is similar to how you would write code, matching your style and naming conventions.
The suggestions are shown in the editor as you type.
You can also trigger the code completion by pressing AltShift0\.
tip
If there are no suggestions, the code might already be complete.
To apply the suggestion:
Press Tab to accept the entire suggestion. You can configure a different shortcut for this action.
Press Ctrl0→ to accept a suggestion word by word.
Press End to accept a suggestion line by line.
To reject the suggestion, press Esc. Alternatively, just continue to write your own code or change the caret position either with the arrow keys or by a mouse click.
You can change the default cloud completion shortcut that you use to accept suggestions.
Hover over the suggestion.
In the popup that appears, click
and select the key that you want to use for accepting suggestions, for example, 0→.
To assign your own shortcut, select Custom.
You can also change any code completion shortcuts in the Settings | Keymap anytime.
The cloud completion option is enabled by default. To configure the way it works, press CtrlAlt0S to open the settings and go to Editor | General | Inline Completion.
Enable the necessary options to personalize your experience with code completion.
Setting | Description |
---|---|
Enable cloud completion suggestions | Enable cloud code completion and select the languages that you want to use cloud completion with |
Completion policy | Select the number of code suggestions you want to get: a brief Focused mode, the default Balanced mode, or a more verbose Creative mode |
Enable code completion indicator | This option colors the caret in purple to indicate that code completion is invoked |
Enable syntax highlighting in completion suggestions | This option turns on the code highlighting for the suggested code. If disabled, the suggested code is shown in gray font. |
Enable multi-line suggestions | Clear this checkbox to leave only single-line suggestions |
Synchronize inline and popup completions | Select this option to see suggestions listed in a popup that appears in the editor while you type. This way, you can avoid shortcut conflicts. |
To disable cloud code completion, clear the Enable cloud completion suggestions checkbox on the same settings page or in Settings | Tools | AI Assistant.
When GoLand detects code that produces pre-compilation errors, it suggests a quick-fix directly within the editor.
AI Assistant can suggest more precise fixes applicable to your specific case due to its context awareness.
Place the caret at a highlighted error in the editor. Then click the red light bulb icon
or press AltEnter to open the list of suggestions.
Click Fix with AI.
AI Assistant sends the entire file together with related files as context to the LLM to determine which fix would be most suitable in this particular case.
The code is then updated directly in the editor.
Thanks for your feedback!