Skip to content

How to Use Auto Completion in Trae

Trae has a built-in native AI code completion feature. While writing code in the editor, the AI assistant reads and understands the written code, then automatically continues it.

Auto Code Completion

When you press the Enter key to create a new line at the cursor's position, the AI assistant will read and comprehend the current code and then automatically complete the subsequent code for you.

When you hover the mouse over the auto-completed code area, you can:

  • Press the Tab key to insert all the auto-completed code at once
  • Use the Ctrl + → shortcut to add the code word by word

Comment-based Code Completion

Add comments in the desired position, then press the Enter key to create a new line. The AI assistant will read and understand the code comments, then generate relevant code accordingly.

When you hover the mouse over the auto-completed code area, you can:

  • Press the Tab key to insert all the auto-completed code at once
  • Use the Ctrl + → shortcut to add the code word by word