Disable Format for Code Sections

When format is disabled, a code section is completely ignored, that is it is not formatted, nor it contributes to formatting.

  • Disable format for a code section - Code sections between the @formatter:off and @formatter:on pragmas are not formatted.

Initial code

Code Formatted without “on”/”off” pragmas

Code Formatted with “on”/”off” pragmas

../../_images/disable-formatter-before-e.png
../../_images/disable-formatter-after-without-pragma-e.png
../../_images/disable-formatter-after-with-pragma-e.png
  • Disable format for a single line - Lines containing the @fomatter:skip pragma inside a comment are not formatted.

Initial code

Code Formatted without “skip” pragma

Code Formatted with “skip” pragma

../../_images/disable-formatter-before-e.png
../../_images/disable-formatter-after-without-pragma-e.png
../../_images/skip-formatter-after-with-pragma-e.png