Skip to main content

Using Autocomplete and Auto-Format in the Code Editor

Learn about the Autocomplete and Auto-Format features in the CodeHS Editor

Meg Fiorentini avatar
Written by Meg Fiorentini
Updated this week
banner showing that this is a free feature

Autocompleting in the Code Editor

Autocomplete in the code editor allows parentheses and braces to be autocompleted while coding. To activate this feature:

  1. In your Account Settings, click the IDE tab

  2. Under "Editor Behavior Settings", toggle on Editor Autocomplete

Gif showing how to turn on autocomplete

In Account Settings can also choose to default to block view in the editor when possible. To learn more about block coding, check out our article here!


Autoformatting JavaScript Programs in the Ace Code Editor

Autoformatting is available in all CodeHS JavaScript programs in the Ace Editor. The formatter, Prettier, makes sure that all code conforms to a consistent style. Learn more about Prettier here.

Once this setting is turned on, the program will automatically format the code each time students save the program. To enable Auto-Format:

  1. Click the gear icon in the upper left corner to access the editor Settings

  2. Under the "Editor" category, toggle on the Auto-Format option

Gif showing auto-formatting in JS code editor

Autoformatting in the Monaco Code Editor

We can also autoformat documents using the Monaco Code Editor. Autoformatting in this editor is only available for the following program types:

  • JavaScript

  • HTML

To switch to the Monaco Editor, follow these steps:

  1. Click the gear icon in the upper left corner to access the editor Settings

  2. Under the "Editor" category, click on the dropdown menu to switch to the Monaco Editor

Now that you've switched to the Monaco Editor, you can format the file! To do so, follow these steps:

  1. Highlight the text that you want to format

  2. Right-click the highlighted text

  3. Click on Format Document

To learn more about the Monaco editor, check out our full article here.


Still have questions? Contact our team at support@codehs.com to learn more!

Did this answer your question?