Use AI prompts to explain and refactor your code
Use prompts to explain code and find problems in your code.
Explain code
Select a code fragment and right-click it to open the context menu.
Select AI Actions and then Explain Selected Code.
The AI Assistant tool window will open to provide you with an explanation.
Find problems
Select a code fragment and right-click it to open the context menu.
Select AI Actions and then Find Problems.
The AI chat will open to show the potential issues you may want to look into.
Modify built-in prompts
You can adjust how AI Assistant behaves in certain scenarios by modifying the prompts used for the corresponding actions.
Do one of the following:
Right-click anywhere in the editor to open the context menu, then go to
.Press ⌘ , to open settings and then select
.
Select the action for which you want to modify the prompt.
Add new instructions.
Click Apply.
The provided instructions will be appended to the default prompt, extending the functionality of the corresponding action.