提交 e6624566 编写于 作者: E Eyas

Don't include `public` keyword in completion inside an interface

Fix #732. C# completion list must not suggest `public` as a potential
accessibility modifier to use inside an `interface { }` block;
otherwise, it produces code that does not compile.
上级 696a16be
......@@ -183,7 +183,7 @@ public void InsideStruct()
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public void InsideInterface()
{
VerifyKeyword(
VerifyAbsence(
@"interface I {
$$");
}
......
......@@ -26,7 +26,7 @@ private static bool IsValidContextForMember(CSharpSyntaxContext context, Cancell
if (context.SyntaxTree.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
context.IsMemberDeclarationContext(
validModifiers: SyntaxKindSet.AllMemberModifiers,
validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations,
canBePartial: false,
cancellationToken: cancellationToken))
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册