提交 d48c8b30 编写于 作者: C CyrusNajmabadi 提交者: GitHub

Merge pull request #16840 from CyrusNajmabadi/fixedUnsafeOutlining

We should have structure guides and outlining for 'fixed' and 'unsafe' statements.
......@@ -37,6 +37,42 @@ void M()
Region("textspan", "hint", CSharpStructureHelpers.Ellipsis, autoCollapse: false));
}
[Fact, Trait(Traits.Feature, Traits.Features.Outlining)]
public async Task TestUnsafe1()
{
const string code = @"
class C
{
void M()
{
{|hint:unsafe{|textspan:
{$$
}|}|}
}
}";
await VerifyBlockSpansAsync(code,
Region("textspan", "hint", CSharpStructureHelpers.Ellipsis, autoCollapse: false));
}
[Fact, Trait(Traits.Feature, Traits.Features.Outlining)]
public async Task TestFixed1()
{
const string code = @"
class C
{
void M()
{
{|hint:fixed(int* i = &j){|textspan:
{$$
}|}|}
}
}";
await VerifyBlockSpansAsync(code,
Region("textspan", "hint", CSharpStructureHelpers.Ellipsis, autoCollapse: false));
}
[Fact, Trait(Traits.Feature, Traits.Features.Outlining)]
public async Task TestUsing1()
{
......
......@@ -130,6 +130,8 @@ private string GetType(SyntaxNode parent)
case SyntaxKind.CatchClause: return BlockTypes.Statement;
case SyntaxKind.FinallyClause: return BlockTypes.Statement;
case SyntaxKind.UnsafeStatement: return BlockTypes.Statement;
case SyntaxKind.FixedStatement: return BlockTypes.Statement;
case SyntaxKind.LockStatement: return BlockTypes.Statement;
case SyntaxKind.UsingStatement: return BlockTypes.Statement;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册