Skip to content

Format Document during Code Cleanup does not respect my style settings #80877

@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


[regression] [worked-in:2022]
I have my tab settings to size 2 and to keep tabs:
image.png

If I format the document manually the settings are respected:
image.png

But if I run a code cleanup that includes “Format document”:
image.png

Wrong indentation settings are used:

image.png

I get this both when running Code Cleanup manually and when I have it configured to run on save.

Visual Studio 2022 does not have this error.


Original Comments

Feedback Bot on 10/14/2025, 03:00 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

YI CHWEEN ONG (Centific Technologies Inc) [MSFT] on 10/21/2025, 00:57 AM:

Thanks for your sharing the detail steps, I can reproduce this issue through your shared steps and this issue has been escalated for further investigation, if there is any process, I will inform you immediately.

Rami Jarakivi on 10/23/2025, 11:07 PM:

I’m also seeing this on 2026 Insiders edition, version 11121.172. Very very very annoying

Jonas Hertzman on 10/24/2025, 02:11 AM:

I found another formatting issue that is probably related to this bug too.

If you do any refactoring, for example “Extract method”, both this preview next to the menu:
image.png

And the refactored code uses wrong indentation settings:
image.png

This also works fine in Visual Studio 2022.

Feedback Bot on 10/24/2025, 07:10 AM:

This issue is currently being investigated. Our team will get back to you if either more information is needed, a workaround is available, or the issue is resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions