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.
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 . Write your prompt in the input field and press .
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 .
Type your prompt right in the editor where you want to make adjustments and press .
If you want to improve the generated code, click Modify Prompt, add new requirements, and press .
AI Assistant will regenerate the code while taking into account the new specifications.
Click Accept 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.
note
Currently, JetBrains Fleet supports code completion for Terraform, Kotlin, and Python.
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 .
tip
If there are no suggestions, the code might already be complete.
To apply the suggested code, press .
Acceptance of code autocompletion by pressing occurs as follows:
If there is no basic autocompletion popup, pressing will accept the entire suggested gray string.
If both the basic JetBrains Fleet autocompletion popup and the gray completion string are present, pressing once will accept the first word, and pressing again will accept the entire string.
To reject the suggestion, press . 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.
To assign your own shortcut, select Custom.
You can also change any code completion shortcuts in the Settings | Keymap anytime.
To hide code completion suggestions from the AI Assistant, right-click the code and select AI Actions | Disable AI Code Completion.
To disable code completion suggestions from the AI Assistant, use one of the following options:
Clear the checkbox in the settings: press to open settings and select Editor | Code. In the Code section, find and clear the Show AI completion checkbox. This setting is applied globally for all languages.
Modify settings.json: for more granular, per-language settings, specify the desired configuration in settings.json. Consider the following example:
"[kotlin]": { "aiCompletion.enabled": false }