dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.06k stars 4.04k forks source link

if block not indented after else #16328

Open miloush opened 7 years ago

miloush commented 7 years ago

Version Used: 2.0.0.61213

if (true) { }
else
if (false) { }

should be auto-formatted (after typing } or explicitly formatting document) as

if (true) { }
else
    if (false) { }
Pilchie commented 7 years ago

Interesting. We don't touch the indentation of the if at all, no matter where it is.

Related to https://github.com/dotnet/roslyn/issues/12315