How can I undo only one given auto-format operation in VS Code?
<p>In Visual Studio, Auto-formatting will occur, e.g., after completing the syntax of a C# function definition via close-parenthesis or after typing a semicolon. Sometimes, this is great! Other times, the auto-formatting destroys my alignment intention by applying its own, different opinion on the matter. Consider this example:</p>



<pre class="lang-cs prettyprint-override"><code>// Before finishing the method definition, no auto-formatting:
public OverloadedConstructor(int[] things, int andSuch)
  : this(things, andSuch,
         new HelperObject(andSuch) /* missing a ')' here */ { }

// After finishing the method definition by adding the missing ')'
public OverloadedConstructor(int[] things, int andSuch)
  : this(things, andSuch,
  new HelperObject(andSuch)) { }
</code></pre>

<p>Regardless of which alignment you may prefer, Visual Studio never really destroys my intention because the auto-format operation is inserted into the undo stack. If I ever wish to undo its auto-format operation, I merely press Ctrl+Z and my original formatting is recovered. I would press Ctrl+Z again if I wanted then to undo the typed close-parenthesis.</p>

<p>However, in Visual Studio Code, the auto-format operation is combined with the parenthesis input--upon pressing Undo, VSCode removes the auto-format as well as the close-parenthesis I just typed, the re-typing of which again causes the erroneous auto-format, which puts me in a never-ending loop of frustration!</p>

<p>I have tried searching for a setting that will reproduce Visual Studio's behavior of having a separate undo history for auto-formatting operations, to no avail. <strong>Is there a setting that will preserve this "undo auto-formatting separately" workflow, or is there a different workflow I should learn for VSCode to individually decide per auto-format whether to keep its effects?</strong></p>