Monaco Code Formatting

Is there a way to beautify the code in Monaco? It seems to add all of the body content as one long line? Line 17 in this case. Makes it hard to read.

Hello Brad,
For HTML/CSS/JS you can either right click and select Format document, or use the shortcut keys combination: Shift-Alt-F

In the final integration of Monaco in Wappler, we will be adding auto format on save. (it’s still an experimental feature and work in progress.)

2 Likes

Auto format on save would be awesome. Thanks!

1 Like

Monaco code formatter works really well. It will be great when we can use it with PHP files.

The feature does such a good job that it having auto format on save could certainly be useful. However, I would still like the option to switch this off; generally I would prefer to choose when the code is formatted.

The shortcut you mention - Shift+Alt+F - functions differently if there is a selection: it will only format the selected code, which is very useful. The command palette lists a different shortcut for this, but it’s not needed, and, IMO, is much less convenient/easy to use.

Hi Brad, you can already enable/disable this option in Wappler settings:

1 Like