Code Formatter Wizard

Code Formatter Wizard

This Wizard is used to Format Code in IDE. Now only Supports Pascal.

With the Default short Ctrl+W, You can Format Current Pascal Source File or Selection in Editor. If Formatting Section, Section will be Extended to Whole Lines before Formatting.

Settings

The Setting Dialog of This Wizard is as below:

- Common Settings

- Keyword: Specify how to Process Keywords. Default is Lower Case.

- Begin Style: Specify where to Put "begin" when Meeting Structureed Statements like if...then or with...do. Defaultly Put to Next Line. Note: This Option does NOT Affect Procedure or Function Body.(Always use Next Line.)

- Tab Indent: Space Count for Tab Indent. Default is 2.

- Space Before Operator: Space Count before an Operator. Default is 1.

- Space After Operator: Space Count after an Operator. Default is 1.

- Auto Wrap: There are 2 Line Width in Auto Wrap Setting: the Smaller One "Break Line Width" and the Bigger One "Exceeding Width". When a Line Exceeds the "Exceeding Width", it will be Broken to Next Line at "Breake Line Width". This Feature can avoid some Minor Contents at Next Line when the Original Line is a Little Longer than "Exceeding Width".

- Single Line Mode for Every Uses Unit: If Checked, Every Unit Name in Uses Area will Occupy One Line, Otherwise Use a Simple auto Wrap Mode with the above Break Line Width. Note: The uses Area in Project Source will Always Occupy One Line Each for there may be 'in' and File Path after Unit Name.

- Keep User Line Break in Statement: If Checked, Line Breaks in a Statement will be kept. Auto Wrap Options will be ignored.

- Use IDE Internal Symbols to Correct Identifiers: If Checked, Code Formatter will Compile Current Unit and Use IDE Internal Symbols to Correct the Identifiers in Source. This Feature Depends on Input Helper.

- Compiler Directive: For some Compiler Directives such as {$IFDEF} {$ELSE} {$ENDIF}, Our Wizard can't Process them Perfectly, and Treat them as Comments Defaultly. But usually Causes Syntax Error for "Duplicated Elements". This Option allow to Only Format the First Branch of Conditional Defines({$IFDEF} {$ELSE} of {$IFDEF} {$ELSE} {$ENDIF}), and Keep Others Unchanged.

- ASM Settings

- Line Head Indent: Space Count at Line Head (Except Label) in Inline ASM Code. Default is 8.

- Tab Width: Tab Width in Inline ASM Code. Default is 8.

- Do NOT Format Content between {(*} and {*)}: If Checked, Contents between {(*} and {*)} won't be Formatted and will Keep its Original Format.

- Shortcut: Change Shortcut for Menu Items Here.

- OK: Confirm modification.

- Cancel: Cancel this modification.

- Help: Show this help.

Limitation and Known Problems

- About Compiler Directive: We Treat Compiler Directives as Comments. So if You have Code such as {$IFDEF XXX} var A: Byte; {$ELSE} Word;{$ENDIF}, Code Formatter will Raise Error. Please Notice it.

- About Comment: We Keep the Original Format when Processing Comments, basically NO Change compared to Formatting Results. So maybe seems NOT so Good.

- Settings Limited: Now This Wizard only Provides A Few Settings. We'll Provide More Later.

- C/C++ Code: Not Supported yet.

Links

Basic Operation

CnWizards Settings

About CnWizards

Copyrights 2001-2025 CnPack Team