Source Code Formatter

The formatting of a whole file can be accomplished using the File > Format command, and of selected text using the Edit > Format command. When formatting, DAC preserves the offset of the first line in the selected block. Empty lines, lines that contain preprocessor directive, and lines containing the continuation of the comment started before the block are skipped when determining the column for formatting.

Block comments are formatted only if they begin with a string defined by Options > Formatter / Block Comment prefix. Line comments are positioned in the column defined by Options > Formatter / Line comment offset. The type of comment formatting can be chosen using Options > Formatter / Comment Format. The width of the formatted text is determined by Text Width, which can be set using the Options > Editor / C Source dialog box.

Options > Formatter / Comment Format = "/* Comment */"

/*+ This is the block comment formatted so it begins at
*** the left and ends at the left */
Statement; /* Line comment */
Statement; /* Multi-line line comment 
           ** second line of line comment */

Options > Formatter / Comment Format = "/* Comment           */"

/*+ This is the block comment formatted so it begins at
*** the left and ends at the right side                  */
Statement; /* Line comment                               */
Statement; /* Multi-line line comment
           ** second line of line comment                */

DAC affords the possibility of formatting C++ comments.

The type of C language block formatting can be set using Options > Formatter /
Parentheses Format
:

In the same line:

function( ) {
}

Same indent level:

function( )
{
}

Next indent level:

function( )
   {
   }

While formatting, DAC can remove excess spaces, as determined by Options > Formatter / Remove multiple spaces.


Copyright 1993-2017, RistanCASE GmbH