Visual Studio 2022 formatting issue
See original GitHub issueVersion Used: Visual Studio 2022, 17.40
I’m using C# and have formatting issue since upgrading to 17.40
Expected Behavior: 1.
if () {
if () |{}
press Enter
if ()
|{}
Actual Behavior: 1.
if () {
if () |{ }
press Enter
if ()
|{ }
This was working as expected in previous version of VS2022, something broke in the newer. I haven’t changed any setting besides turning off the new thing that selects text with the same characters as currently selected.
Indenting is set to block
, insert spaces, automatically format while typing and on return is turned off.
Please help, this is really bothering.
After I complete } space is inserted between {} e.g. if () |{ }`. After I press enter while the caret is located before opened bracket, Actual Behavior step 3. happens.
Issue Analytics
- State:
- Created 10 months ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Microsoft Visual Studio 2022 - Stop All and Any Formatting
Settings > Text Editor > C# > Code Style > Formatting > General: Uncheck "Automatically format on... (all options to disable all).
Read more >C# editor formatting options - Visual Studio (Windows)
Use the Formatting options page and its subpages (Indentation, New Lines, Spacing, and Wrapping) to set options for formatting code in the code ......
Read more >Bringing Code Cleanup on Save To Visual Studio 2022 ...
Starting in Visual Studio 2022 17.1 Preview 2, developers can now perform Code Cleanup automatically when a file is being saved!
Read more >Format on Save for VS2022
Settings in Tools -> Options -> Format on Save. I found it convenient to unify source code format throughout the develop team. If...
Read more >CSS Error in SCSS File & Formatting Issue (VS 2022)
A fix would be nice] Hi,. I have come across 2 more errors in Visual Studio 2022 (17.2.0) and they are both to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jasonmalinowski @tmat I rolled back to 17.3.6 and it’s working properly there.
This makes me think it’s probably the same issue as fixed by https://github.com/dotnet/roslyn/pull/65382.