Autocompleting in the Code Editor
Autocomplete in the Code Editor allows parentheses and braces to be autocompleted while coding. You can activate this function in your Account Settings using the IDE menu on the left side. You 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, click the gear icon in the upper left corner to access the Editor Settings and toggle the Auto-Format control under 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
In order to switch to the Monaco Editor, follow these steps:
Click on the cog icon in the lefthand navigation bar.
Scroll down to the "Editor" section, and click on the dropdown menu to switch to the Monaco Editor
Now that we've switched to the Monaco Editor, we can now format the file! To do so, we can follow these steps:
Highlight the text that you want to format
Right click the highlighted text
Click on "Format Document"
To learn more about the Monaco editor, check out our full article here.
Still have questions? Contact our team at hello@codehs.com to learn more!