AI prompt library
You can add your own prompts to the prompt library and use them as context actions in the AI Assistant submenu of the Alt+Enter popup.
Configure prompt library
Do one of the following:
In the AI Assistant window, click Prompt Library and then click Change prompts.
In the editor, press Alt+Enter and choose
Open the Alt+R, O and click Open Library
page of ReSharper options
In the dialog that opens, click Add New Prompt in the bottom left corner.
A new prompt will appear in the User prompts category on the left. Click the three-dots button next to it and give it a short and descriptive name.
In the text field, write your prompt. You can use the
$SELECTION
variable, which will be replaced with the selected code and its language when you invoke the prompt from the editor.When the prompt is ready, you can experiment with improving it: click Improve and see whether it became better. If not, click the revert button in the text field.
Select Show in Alt+Enter menu to make the prompt appear in the AI Assistant submenu of the Alt+Enter popup.
By default, your prompt will be sent for processing as soon as you choose it in the Alt+Enter popup. If you want to make the prompt more flexible, choose Use for additional input after invoking. In this case, the prompt will be sent to the AI Assistant window where you will be able to edit it before sending.
Click OK to finish creating the prompt.