In-editor code generation
With AI Assistant, you can generate code right in the editor.
To generate code in the editor, do one of the following:
Place the caret anywhere in the editor and press Ctrl+\. 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.

Wait for the generation to complete. The generated code will be shown in the same editor tab where you have written your prompt.

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 Ctrl+F5.
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.