How to ignore formatting a part of the code in Delphi IDE code formatter?

226 Views Asked by At

I've found a question from 12 years ago, when there wasn't a way to ignore a part of code in Embarcadero Delphi's code formatter. Has something changed since then, and there is some way to do this now?

3

There are 3 best solutions below

1
Remy Lebeau On BEST ANSWER

At the time of this writing, there is no way to tell the code formatter to ignore a portion of code. The formatter applies to the entire file, unless you have selected a piece of code then it formats just that code instead.

0
Bruce McGee On

Not in the current version.

You can format just a selected block, but a way to automatically exclude a block of code would be great.

1
Delphi Coder On

The code formatter coming with the GExperts plugin for Delphi can exclude code parts from formatting using special directives in code. Per default {(*} for start and {*)} for end an block are used where no formatting shall take place.

These directives are also fully customizable in the options dialog for the code formatter: GExperts code formatter misc. options