In this first "beta blog" I'll discuss an IDE feature that's not covered in the first beta video, namely improvements in code formatting . I picked this specific topic not because it it the most important feature of the product, but because it is a tiny gem that I can easily discuss in a blog post. Covering something like the extensive subversion integration in a blog post is quite hard, I have to say.

In case you don't know, "Delphi beta blogs" are authorized blog posts by independent bloggers covering features of a beta version of Delphi. This means I was given a specific permission to post about this topic and I'm discussing a feature of a pre-release version. Notice also that the official RAD Studio XE Preview page is at . Since this is a pre-release, there is no guarantee it will work the same in the final version (or will actually be in the product).

Source Code Formatting

Source code formatting was introduced in the Delphi 2010, but it had a couple of weaknesses that limited its usefulness. First, you could format the selected lines of a unit or a full unit, but not all of the units of a project at once. Second, if you customized the format settings there was no obvious way to copy the settings to another computer or share them with the other members of your team, to keep the source code format consistent.

New: Format Project

Delphi XE addresses both issues, adding some further formatting options. The first and more obvious change is that you can now use the Project | Format Project Sources menu item or the corresponding entry of the Project Manager local menu (on a project node). As the name implies, this applies the current source format settings to all of the units of the current project, after showing a confirmation dialog.

As you reformat a project you get some status information on a dialog which you can barely glance to (more or less like when you compile), but this is all added to a specific tab of the Messages pane, like in the following simple case:

      Starting format sources in project C:\Users\Marco\Documents\RAD Studio\Projects\Project5.dpro 
        Formatting C:\Users\Marco\Documents\RAD Studio\Projects\Project5.dpr ... 
        Formatting C:\Users\Marco\Documents\RAD Studio\Projects\Unit8.pas ... 
      Format project sources finished

If you format an individual unit, instead, the dialog below will let you disable further confirmations and won't output its status to the Messages pane:


Formatter Profiles

The Formatter | Profiles and Status page of the Options dialog box mentioned in the message box above contains the specified settings and also the option to disable the code formatter, removing the corresponding menu items.

Its main goal, though, is to let you manage the active settings of the formatter, picking one of the predefined options, updating it, and saving the current settings to a custom file. If you save the files in the Delphi user's “roaming” folder, like in my case:


and it's named with the pattern “Formatter_*.config” it will be picked by the IDE and listed in combo box at the top of the page, if not you can still locate it with a File Open Dialog. The top of the page is shown below:

Interestingly enough, a formatter profile is a rather plain XML file you might even edit or process directly. At the beginning there are the global settings, followed by the specific settings for each language, grouped by category using some comments:

That's all for this first post. Will find time for a few more in the coming days and weeks.

PS. Before you ask about the overall features of Delphi XE and the potentially missing features, we'll have to wait for the road map update that Product Manager Mike Rozlog said he's close to release in this thread. Until that information becomes public, there is nothing I can comment upon.