To use Edit Code, follow these steps:

  1. Select the block of code you want to transform.
  1. Right-click in the editor to open up the context menu.
  1. Select Edit code.
  1. Type a prompt for what you would like to change about the highlighted code block in the provided text field and press Send
  1. Replit AI will provide a suggestion to transform your code. From here, you can choose to: 5) View suggested edits - See an inline diff of the code edit. 6) Cycle between views - See the original code, or just the suggested change. 7 & 8) Type a new prompt - Refine your prompt and try again. 9) Discard - Discard the code edit. 10) Accept suggestion - If you like the suggestion, click this and Replit AI will apply the difference in your editor.