AI prompt library
ReSharper | AI Assistant | Prompt Library…
To assign a shortcut, go to Tools | Options | Environment | Keyboard and find the ReSharper_ShowPromptLibraryWindow
command.
note
This functionality relies on the AI Assistant, which requires a separate license.
You can add your own prompts to the prompt library and use them as context actions in the AI Assistant submenu of the AltEnter popup.
Do one of the following:
In the AI Assistant window, click Prompt Library
and then click Change prompts.
In the editor, press AltEnter and choose AI Assistant | Prompt Library...
Open the AI Assistant page of ReSharper options Alt+R, O and click Open Library
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 AltEnter popup.
By default, your prompt will be sent for processing as soon as you choose it in the AltEnter 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.
tip
To customize the global AI Assistant prompt, use the corresponding field on the AI Assistant | General page of ReSharper options Alt+R, O.