未验证 提交 2366c3c5 编写于 作者: Y Youssef Victor 提交者: GitHub

Update help service to account for all `TypeDeclarationSyntax`...

Update help service to account for all `TypeDeclarationSyntax` (namespace+record+struct) as partial type (#48095)
上级 d3131e53
......@@ -284,7 +284,7 @@ private static bool TryGetTextForContextualKeyword(SyntaxToken token, out string
text = "partialmethod_CSharpKeyword";
return true;
}
else if (token.Parent.GetAncestorOrThis<ClassDeclarationSyntax>() != null)
else if (token.Parent.GetAncestorOrThis<TypeDeclarationSyntax>() != null)
{
text = "partialtype_CSharpKeyword";
return true;
......
......@@ -164,7 +164,7 @@ void goo()
}
[Fact, Trait(Traits.Feature, Traits.Features.F1Help)]
public async Task TestPartialType()
public async Task TestClassPartialType()
{
await Test_KeywordAsync(
@"part[||]ial class C
......@@ -174,7 +174,27 @@ public async Task TestPartialType()
}
[Fact, Trait(Traits.Feature, Traits.Features.F1Help)]
public async Task TestPartialMethod()
public async Task TestRecordPartialType()
{
await Test_KeywordAsync(
@"part[||]ial record C
{
partial void goo();
}", "partialtype");
}
[Fact, Trait(Traits.Feature, Traits.Features.F1Help)]
public async Task TestRecordWithPrimaryConstructorPartialType()
{
await Test_KeywordAsync(
@"part[||]ial record C(string S)
{
partial void goo();
}", "partialtype");
}
[Fact, Trait(Traits.Feature, Traits.Features.F1Help)]
public async Task TestPartialMethodInClass()
{
await Test_KeywordAsync(
@"partial class C
......@@ -183,6 +203,16 @@ public async Task TestPartialMethod()
}", "partialmethod");
}
[Fact, Trait(Traits.Feature, Traits.Features.F1Help)]
public async Task TestPartialMethodInRecord()
{
await Test_KeywordAsync(
@"partial record C
{
par[||]tial void goo();
}", "partialmethod");
}
[Fact, Trait(Traits.Feature, Traits.Features.F1Help)]
public async Task TestExtendedPartialMethod()
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册