Skip to content

Commit

Permalink
Fix indentation of consecutive using statements
Browse files Browse the repository at this point in the history
  • Loading branch information
sharwell committed Jan 13, 2016
1 parent 73d56ec commit 354cbf2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1110,10 +1110,10 @@ void MethodName()
}
using (default(IDisposable))
using (default(IDisposable))
{
using (default(IDisposable))
{
int y = 3 + 2;
}
}
using (default(IDisposable))
{
Expand All @@ -1127,8 +1127,8 @@ void MethodName()
return;
using (default(IDisposable))
using (default(IDisposable))
return;
using (default(IDisposable))
return;
}
}
";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,8 @@ public override void VisitLockStatement(LockStatementSyntax node)
public override void VisitUsingStatement(UsingStatementSyntax node)
{
// Allow consecutive using statements without nesting indentation.
using (this.AdjustIndentation(node.Statement.IsKind(SyntaxKind.UsingStatement) ? 0 : 1))
int adjustment = node.Parent.IsKind(SyntaxKind.UsingStatement) ? 0 : 1;
using (this.AdjustIndentation(adjustment))
{
this.AnalyzeUsingStatement(node);
base.VisitUsingStatement(node);
Expand Down

0 comments on commit 354cbf2

Please sign in to comment.