# Customizing formatting with the Ada VS Code Extension

**URL:** <https://forum.ada-lang.io/t/customizing-formatting-with-the-ada-vs-code-extension/1426>\
**Category:** General\
**Created:** [November 1, 2024, 4:33am UTC](https://forum.ada-lang.io/t/customizing-formatting-with-the-ada-vs-code-extension/1426 "2024-11-01T04:33:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pyj](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/pyj/32/5_2.png) [@pyj](https://forum.ada-lang.io/u/pyj)\
**Post date:** [November 1, 2024, 4:33am UTC](https://forum.ada-lang.io/t/customizing-formatting-with-the-ada-vs-code-extension/1426/1 "2024-11-01T04:33:06Z")

</div>

How do ignore lines from being formatted by the Ada extension in Visual Studio Code on Windows? The `--!pp off` and `--!pp on` comments I’ve used before don’t seem to work.

Also, before I’ve added this to the project GPR, which led to correct formatting, but this seems to be ignored:

```ada
   package Pretty_Printer is
      for Default_Switches ("ada") use (
         "-M120", -- Line length
         "-c0", -- Don't change comments.
         "--no-separate-is",
         "--no-separate-loop-then",
         "-l2" -- Compact layout
         );
   end Pretty_Printer;

```

---

<div class="post-metadata">

**Author:** ![simonjwright](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/simonjwright/32/11_2.png) [@simonjwright](https://forum.ada-lang.io/u/simonjwright)\
**Post date:** [November 1, 2024, 8:33am UTC](https://forum.ada-lang.io/t/customizing-formatting-with-the-ada-vs-code-extension/1426/2 "2024-11-01T08:33:05Z")

</div>

I’m battling with this in the context of [Ada TS Mode](https://github.com/brownts/ada-ts-mode).

AdaCore are moving to a new formatting engine [GNAT Format](https://github.com/AdaCore/gnatformat), which

- is opinionated
- has fewer options
- is the default formatting engine for (recent releases of) Ada Language Server
- uses a GPR `package Format`

In VS Code there’s a Formatting setting 'Use Gnatformat`, which s ticked by default.

ALS includes the implementation of both formatting engines, but (at any rate for the PP version) it doesn’t seem to pass all the options through, so you don’t necessarily get the effect you want.

---

<div class="post-metadata">

**Author:** ![pyj](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/pyj/32/5_2.png) [@pyj](https://forum.ada-lang.io/u/pyj)\
**Post date:** [November 2, 2024, 7:35pm UTC](https://forum.ada-lang.io/t/customizing-formatting-with-the-ada-vs-code-extension/1426/3 "2024-11-02T19:35:06Z")

</div>

Thanks for pointing me in the right direction. I set up my Format package rule and opened a [ticket](https://github.com/AdaCore/gnatformat/issues/1) with GNATformat about the situation I’m seeing. Overall it’s been good, I’d just like to be able to ignore some lines.
