Amethyst Help
Back toActionScript Automatic Code Formatting
Amethyst provides extensive options to reformat code according to a range of rules defined by the user.
To access Formatting Options in Amethyst, select: Tools->Options->Text Editor->ActionScript->Formatting
There are five pages of formatting options. In the General page, you may set options to format a completed statement when the semicolon character is added, format a block when the final curly brace is added and auto-format code when it is pasted. The other pages of options apply to: Indentation, Newlines, Spacing and Wrapping. Each option displays the effect on some sample code shown in the dialog itself.

To reformat an entire document, use the Edit, Advanced, Format Document menu or press the Visual Studio hotkey (the default is CTRL+E, D). To format a selection, use the Edit, Advanced, Format Selection menu or press the Visual Studio hotkey (the default is CTRL+E, F).
The full range of formatting options are illustrated below.
Code Formatting Options
Code formatting options are set in a series of pages in the Options dialog which can be accessed by selecting: Tools, Options, Text Editor, ActionScript, Formatting. These are the effects of each option...
General
Automatically format complete block on }
Automatically format complete statement on ;
Automatically format on paste
When enabled the options above will auto-format blocks or statements when the terminating character is entered or when a block of ActionScript code is pasted into the editor.
Indentation
The images below show how your code will be formatted when each option is enabled (true) or disabled (false). Remember that you will need to reformat the document as explained above before any formatting changes will be applied to your code:
Indent block contents
When true...

When false...

Indent open and close braces
When true...

When false...

Indent case contents
When true...

When false...
![]()
Indent case labels
When true...

When false...

Newlines
Open brace on newline for classes & packages
When true...
![]()
When false...
![]()
Open brace on newline for methods
When true...
![]()
When false...
![]()
Open brace on newline for control blocks
When true...

When false...
![]()
Place else on new line
When true...

When false...

Place catch/finally on new line
When true...

When false...

Spacing
Space between method name and parenthesis in definition
When true...
![]()
When false...
![]()
Space between method name and parenthesis in call
When true...
![]()
When false...
![]()
Space after keywords in control flow statements
When true...
![]()
When false...
![]()
Space after comma
When true...
![]()
When false...
![]()
Space before and after assignment operators
When true...

When false...

Space between ’(’ ’)’ and arguments
When true...
![]()
When false...
![]()
Space between ‘:’ and type
When true...

When false...

Space before and after binary operators
When true...
![]()
Ignore spaces around binary operators
When true... no change will be made.
Remove spaces before and after binary operators
When true...
![]()
Wrapping
When the wrapping options are checked, no formatting will be applied to blocks and statements which have been placed onto a single line. If the wrapping options are unchecked, your Newlines options will be applied to blocks and statements on a single line.
Check these options only if it is your habit to put some semicolon-separated statements or some curly-brace-delimited blocks onto one line and you wish these to be excluded from code reformatting.
Leave block on a single line
When true curly-brace-delimited blocks on a single line will not be formatted over multiple lines...
![]()
When false curly-brace-delimited blocks on a single line will be formatted according to your normal options...

Leave statements on the same line
When true groups of semicolon-delimited statements on a single line will not be formatted over multiple lines...

When false semicolon-delimited statements on a single line will be formatted according to your normal options...


