Use AI in editor
Install the AI Assistant plugin
This functionality relies on the AI Assistant plugin, which you need to install and enable.
Press Ctrl+Alt+S to open settings and then select
.Open the Marketplace tab, find the AI Assistant plugin, and click Install (restart the IDE if prompted).
Ask AI Assistant to generate code or start a chat
Generate code using prompts right in the editor or start a chat with AI Assistant.
Generate code in editor using prompts
Select a piece of code that you want to modify or place the caret anywhere in the editor and press Ctrl+\.
Alternatively, right-click anywhere in the editor to open the context menu, select AI Actions and then Ask AI Assistant.
In the input field, write your prompt and press Enter.
Wait for the generation to complete. The generated code will be shown in the same editor tab where you have invoked the input field.
If you want to improve the generated code, in the same input field, write a follow-up message with the new requirements and press Enter.
If you want to improve the generated code, click Specify, add new requirements, 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 to insert the generated fragment.
To discard all the suggested changes, click Discard.
You can use the input field the same way as the AI Assistant chat to ask programming-related questions, invoke the /explain
and /refactor
commands, or reference a particular database schema or file in your query with #
to provide more context.
For more information about the AI Assistant chat features, refer to Chat with AI.