Integrated Formatter

From RAD Studio
Jump to: navigation, search

Go Up to Source Code Formatter

RAD Studio provides the source code formatter integrated into the IDE.

The integrated source code formatter can format Delphi and C/C++ source code files. It can format:

  1. Separate Delphi or C/C++ files (or blocks of code, selected in these files):
    • Use the Edit > Format Source menu command or the Format Source context menu command in the Code Editor to format the file being edited in the Code Editor or to format the selected block of code.
    • Use the Edit > Format Source menu command or the Format Source context menu command in the Project Manager to format the source code file selected in the Project Manager.
  2. All source code files in Delphi and C/C++ projects:
    • Use the Format Project Source context menu command in the Project Manager to format all source code files of the project selected in the Project Manager.
    • Use the Project > Format Project Source menu command to format all source code files of the currently active project (in the Project Manager).

The integrated code formatter uses different sets of formatting options to format C/C++ and Delphi files. You can manage the formatter options active sets:

  • You can customize options in the active set using the Formatter pages of the Options dialog box (Tools > Options > Formatter).
  • You can handle profiles of the formatter options using the Select profile controls and the Restore defaults button on the Profiles and Status page (Tools > Options > Formatter > Profiles and Status).
  • You can save the customized active set of the formatter options in a file using Save As on the Profiles and Status page.
  • You can load formatter options stored in a file using Load on the Profiles and Status page.

See how to manage formatter options in Formatting Source Code.

See Also