JetBrains Fleet 1.37 Help

Use AI in editor

Generate code in editor

Generate code and use prompts right in the editor.

  1. Select a piece of code that you want to modify or place the caret anywhere in the editor and press .

    Alternatively, right-click to open the context menu, select AI Actions and then Generate code.

  2. In the input field, write your prompt and press .

  3. 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.

    If you want to regenerate the answer, click Regenerate.

  4. Click Accept all to insert the generated fragment to the rest of the code.

    To accept only part of the suggested changes, click the Accept button Accept in the Two-Side view or the Checkmark icon Accept in the Unified view on the line with the desired changes.

Invoke inline code completion

AI Assistant can autocomplete single lines, entire functions, and even blocks of code in real time based on the project's context. The generated code is similar to how you would write code, matching your style and naming conventions.

  1. While working on your code, press to start a new line and wait for a few seconds to get a suggestion.

    The suggested code will be shown in gray font.

  2. 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 Esc. Alternatively, just continue to write your own code.

Hide AI Assistant code completion

  • To hide code completion suggestions from the AI Assistant, right-click the code and select AI Actions | Hide AI Completion.

Disable AI Assistant 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 }
Last modified: 21 June 2024