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.png
../../_images/disable-formatter-after-without-pragma.png
../../_images/disable-formatter-after-with-pragma.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/skip-formatter-before.png
../../_images/skip-formatter-after-without-pragma.png
../../_images/skip-formatter-after-with-pragma.png