Today I ran into this problem with my pseudo-code comments and thought that I would share the way I solved.
While there is no way to prevent automatic formatting of parts of Visual Studio code, there is a way to prevent automatic formatting of comments with pseudo-code .
Instead of using something like this
// if condition
// do this
// else
// do something else
use triplex slashes ///instead
/// if condition
/// do this
/// else
/// do something else
As a bonus, you get automatic insertion/// in new lines and automatic indentation , which preserves the level of indentation of previous lines.
It does not depend on the indent parameters of the editor. It also will not ruin the XML documentation.
(, , . , , .)