Skip to main content

Code Format

Code formatting is supported for most languages.

Code Formatters

The code formatter used for each language is specified in the language documentation page.

For example:

  • Prettier is used for many languages including HTML, CSS, JavaScript, TypeScript, JSX, TSX.
  • gofmt (via GopherJS) is used for Go.
  • Parinfer is used for Scheme, Common Lisp and ClojureScript.

Format Button

Code formatting for the code in the active editor can be triggered by the Format button below the editor.

code format

Keyboard Shortcut

Code formatting can also be trigger by the keyboard shortcut Alt + Shift + F.

Format on-save

Format on-save can be enabled from the app menu → Format on-save.

Format Options

Some format options can be configured from Editor Settings screen. These include Prettier configuration options for:

  • Indentation (Spaces/Tabs)
  • Tab size
  • Use Semicolons
  • Use Single Quotes
  • Use Trailing Commas

Configuration

Code format can be configured using the configuration object properties:

SDK Method: format

The code format can be programmatically triggered by the SDK method format.