IDE

Autocomplete and AI suggestions

The editor can help you write code in two ways. Autocomplete suggests names as you type. An inline AI suggestion writes the next part of your code, but only when you ask for it.

They are separate. You can use either one, both, or neither.

Autocomplete

Autocomplete shows a list of suggestions while you type. Use the arrow keys to pick one and Enter or Tab to accept it. Esc closes the list.

It is off until you turn it on. Sign in, open IDE settings, set Autocomplete to Standard, and choose Save. It is free on every plan, including the free account, and does not use any credits.

What you get depends on the language:

  • Java, Python, C, C++, JavaScript, TypeScript, HTML, CSS and JSON. The suggestions know the language. Type a name and a dot, and you see what that thing really has. For example, after a string you see the string methods.
  • C and C++ versions. The suggestions follow the version you picked, such as C99 or C++20, so you only see what that version has.
  • The first suggestion can take a few seconds in Java, C and C++, while the language tools start. After that they are quick.
  • Every other language. You get the language's keywords and the names already in your file.

Autocomplete in JavaScript: after typing t.toUp the list offers toUpperCase, and Enter accepts it

In JavaScript, the list knows that each book title is a string, so it offers the string methods.

Set Autocomplete back to Off if you want a clean screen, for example while you teach a class and want everyone to see the whole line being typed.

Inline AI suggestions

An inline AI suggestion is AI autocomplete that you ask for. Put the cursor where you want code and press Ctrl+I. On a Mac, press Cmd+I.

An inline AI suggestion: the cursor is after return in a word counter, Ctrl+I suggests Counter(words).most_common(n), and Tab accepts it

A word counter: the AI sees the Counter import and the words list, and suggests the line that finishes the function.
  1. The editor says Asking AI… this can take a few seconds. next to the cursor. Wait for the answer.
  2. The suggestion appears in grey text, right after the cursor. It is not part of your code yet.
  3. To accept it, press Tab. The grey text becomes part of your code.
  4. To dismiss it, press Esc. Typing anything or moving the cursor also dismisses it.

To stop a request that is still running, press Esc while the editor says Asking AI….

The AI reads the code before and after the cursor, so the suggestion fits what you already wrote. If it has nothing useful to add, it says No AI suggestion here.

Inline AI suggestions work for every signed-in account, whatever Autocomplete is set to. There is nothing to turn on.

Inline AI suggestions use the same credits as the AI assistant. See AI credits for how many your plan gives you. When they run out, the editor tells you next to the cursor.

If a teacher has turned AI off for the students on their account, inline AI suggestions are off for those students too.

The AI menu

The AI menu lets you ask the AI to write, fix or explain code without leaving the editor. Press Ctrl+K to open it. On a Mac, press Cmd+K. If you select code with the mouse, you can also click Edit with AI next to it.

The menu opens under the line you are on. You can type what you want, or pick an option. Each option has a number, so Cmd+K then 3 fixes the selected code straight away.

Key Option Works on
1 Suggest code here The cursor. Same as Ctrl+I.
2 Fix the error from my last run The selection, or the whole file
3 Fix the selected code The selection
4 Explain The selection, or the whole file
5 Add comments The selection, or the whole file
6 Make it simpler The selection
7 Make it faster The selection

An option is greyed out when it cannot be used, and the menu says why. For example, Fix the error from my last run needs a run that failed.

To ask for something else, type it and press Enter. With code selected, the AI changes that code. With nothing selected, it writes new code at the cursor.

Check the change before it goes in

The AI never changes your code on its own. It shows a preview first:

  • Lines it removes are red and crossed out.
  • Lines it adds are green.
  • One sentence says what it changed.

Press Tab to accept the change, or Esc to reject it. Not quite right? Type what to change, for example "use a for loop", and press Enter. The AI changes its suggestion, and you see a new preview.

Explain does not change your code. The answer appears in the menu. To ask more, type a follow-up question and press Enter.

While the AI works, the menu shows a small animation and the text box is locked. Press Esc to stop.

To keep going in a bigger space, choose Continue in AI tab. The conversation moves to the AI tab, and you can carry on from there.

AI menu examples

Each example below is a real answer from the AI.

Fix the selected code

This binary search never finishes, because low = mid can stop the search from moving. Select the function, press Cmd+K, then 3.

The AI menu fixing a binary search: the preview shows low = mid replaced by low = mid + 1, and Tab accepts it

The preview explains the bugs it found and shows each changed line before you accept.

Fix the error from your last run

This Java program stops with a NullPointerException, because there are no bananas in the map. After the failed run, press Cmd+K, then 2. You do not need to copy the error: the AI reads it from the output.

The AI menu fixing a NullPointerException in Java: the preview replaces int bananas with an Integer and a null check

The AI reads the error from your last run and fixes the line that caused it.

Explain, and ask follow-up questions

Select code you want to understand, press Cmd+K, then 4. Then ask a follow-up question in your own words.

The AI menu explaining a prime number sieve, then answering why the inner loop starts at p * p

A prime number sieve, explained step by step, then a follow-up question about one line.

Make it faster

This function compares every email with every other email, which is slow on a long list. Select it, press Cmd+K, then 7.

The AI menu making a duplicate email finder faster by replacing the nested loops with a set

Two nested loops become one loop and a set, and the result stays the same.

Make it simpler

Deeply nested if and else blocks are hard to read. Select them, press Cmd+K, then 6.

The AI menu turning nested if and else blocks for letter grades into a flat elif chain

The same letter grades, written as one flat list of conditions.

Add comments

Select code that has no comments, press Cmd+K, then 5. The code itself does not change.

The AI menu adding comments to a Caesar cipher in JavaScript

A Caesar cipher, with a comment for each step.

Write new code from your own words

Put the cursor where the code should go, press Cmd+K, and type what you want. Press Enter.

The AI menu writing a best of three rock, paper, scissors game from a typed request

A rock, paper, scissors game, written from one sentence and the code already in the file.

On Windows and Linux, press Ctrl+K instead of Cmd+K.

What next

Editor settings lists every other setting.

Keyboard shortcuts lists every key the editor understands.

The AI assistant answers questions about the code you have open.

This website uses cookies to ensure you get the best experience on our website.