You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/Rules/AnchorIndentationFormattingRule.cs
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,8 @@
3
3
// See the LICENSE file in the project root for more information.
4
4
5
5
usingSystem.Collections.Generic;
6
+
usingSystem.Linq;
7
+
usingMicrosoft.CodeAnalysis.CSharp.Extensions;
6
8
usingMicrosoft.CodeAnalysis.CSharp.Syntax;
7
9
usingMicrosoft.CodeAnalysis.Formatting.Rules;
8
10
@@ -49,6 +51,24 @@ public override void AddAnchorIndentationOperations(List<AnchorIndentationOperat
49
51
switch(node)
50
52
{
51
53
caseStatementSyntaxstatement:
54
+
// Don't add anchor indentation for if statements that are on a separate line from their else keyword.
55
+
// The if statement should be indented like any other embedded statement in that case.
0 commit comments