Despite we have JCF ported and available by default, it works as a parser. That means, when it sees syntax error, it will stop formatting. The downside of such approach is that if the parser is not updated with bleeding edge language feature supported by the compiler, such a code will fail to format.
PToP is a solution in such a case because it works as a lexer, formatting is done based on token options only. No matter how broken your code is, PToP won't throw any error and format as far as it can (of course, wrong formatting could happen in such a case).
PToP is the original FPC beautifier written by Michael van Canneyt, one of FPC core developers, ported from other code which can be read in ptopu unit. I present you a Lazarus package that integrates PToP to our lovely IDE. You can directly format active window by pressing Ctrl+Shift+Alt+D or by choosing any of the option in Source->PToP. A settings dialog is available either from Source->PToP->Format Settings or Options->PToP->Settings whose screenshot can be seen attached. The package is
hosted on bitbucket and is managed using Mercurial. No direct download is available ATM because I state the package now as alpha quality. Feel free to report for bugs.
There is one oddity currently: in order the settings to be populated, you must run one of the formatting option once. I need someone who has more experience in writing IDE integration package to take a look and tell me what I do wrong.