dotnet / format

Home for the dotnet-format command
MIT License
1.92k stars 174 forks source link

Legitimate whitespace error triggering other unrelated invalid whitespace errors in same file #2045

Open Inirit opened 8 months ago

Inirit commented 8 months ago

I've come across a strange behavior with dotnet format --verify-no-changes that I can't make sense of. I've created a minimal example at https://github.com/Inirit/dotnet-format-bug-repro/tree/main and I've explained the setup below:

There's four source files: NoRepro1.cs, NoRepro2.cs, NoRepro3.cs, and Repro.cs. All four files have a single class with a single simple method with slight differences between the method bodies.

sharwell commented 6 months ago

:memo: If this issue can be reproduced in Visual Studio using IDE0055 and/or the Format Document operation, it would need to be moved to dotnet/roslyn for further investigation.