Skip to main content

Edit Code

With Edit Code, Replit AI can refactor your code to run faster, translate it into another language, and make your code easier to read

To use Edit Code, follow these steps:

  1. Select the block of code you want to transform.
  2. Right-click in the editor to open up the context menu.
  3. Select Edit code.
  4. Type a prompt for what you would like to change about the highlighted code block in the provided text field and press Send
  5. 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.