UI input boxes for action code fields can use syntax highlighting. Currently, syntax highlighting is only implemented in the code sub-tabs of the Action Inspector and stamps but support will likely expand in subsequent releases.
From v9.1.0, code syntax colouring is applied to link actions (Links Inspector) and note using the built-in 'Action' prototype.
Coloured highlighting assist in spotting simple coding mistakes:
- Double-quoted strings are red.
- Single-quoted strings are orange.
- Attribute references are purple.
- Operators appear in blue. The function operator (v9.1.0) is coloured blue but function names are not.
- Comments appear in grey.
- The variable 'var' command in green (v9.1.0). Note that variable names, including function inputs and loop variables are not coloured.
- Unmatched parentheses, brackets and braces are highlighted.
Notes:
- Nesting unmatched quotes, i.e 2 doubles around a single or vice versa, will (may) cause that expression within the overall action to be wrongly coloured. If correctly coded, this glitch (due to regex limitations) will not affect the functioning of the code.This does not affect
- Code syntax highlighting of Action Code cannot be set by the user (i.e. by using custom highlighters),. However, from v9.1.0, applying the Action prototype will enable code colouring.