Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3119,6 +3119,66 @@ public void M()
AutoFormatToken(code, expected, useTabs);
}

[WpfTheory]
[CombinatorialData]
[Trait(Traits.Feature, Traits.Features.SmartTokenFormatting)]
public void UsingStatementWithNestedCheckedStatement(bool useTabs)
{
var code = @"class C
{
public void M()
{
using (null)
checked
{
}$$
}
}";

var expected = @"class C
{
public void M()
{
using (null)
checked
{
}
}
}";

AutoFormatToken(code, expected, useTabs);
}

[WpfTheory]
[CombinatorialData]
[Trait(Traits.Feature, Traits.Features.SmartTokenFormatting)]
public void UsingStatementWithNestedUncheckedStatement(bool useTabs)
{
var code = @"class C
{
public void M()
{
using (null)
unchecked
{
}$$
}
}";

var expected = @"class C
{
public void M()
{
using (null)
unchecked
{
}
}
}";

AutoFormatToken(code, expected, useTabs);
}

[WpfTheory]
[CombinatorialData]
[Trait(Traits.Feature, Traits.Features.SmartTokenFormatting)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ private static bool IsSpecialContainingNode(SyntaxNode node)
node.Kind() == SyntaxKind.LabeledStatement ||
node.Kind() == SyntaxKind.LockStatement ||
node.Kind() == SyntaxKind.FixedStatement ||
node.Kind() == SyntaxKind.UncheckedStatement ||
node.Kind() == SyntaxKind.CheckedStatement ||
node.Kind() == SyntaxKind.GetAccessorDeclaration ||
node.Kind() == SyntaxKind.SetAccessorDeclaration ||
node.Kind() == SyntaxKind.AddAccessorDeclaration ||
Expand Down