Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft #48158

Closed
wants to merge 4 commits into from
Closed

draft #48158

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 @@ -1289,46 +1289,8 @@ private static bool IsGlobalAttribute(SyntaxNode node, SyntaxKind attributeTarge

private static bool IsMemberDeclaration(SyntaxNode node)
{
// From the C# language spec:
// class-member-declaration:
// constant-declaration
// field-declaration
// method-declaration
// property-declaration
// event-declaration
// indexer-declaration
// operator-declaration
// constructor-declaration
// destructor-declaration
// static-constructor-declaration
// type-declaration
switch (node.Kind())
{
// Because fields declarations can define multiple symbols "public int a, b;"
// We want to get the VariableDeclarator node inside the field declaration to print out the symbol for the name.
case SyntaxKind.VariableDeclarator:
return node.Parent.Parent.IsKind(SyntaxKind.FieldDeclaration) ||
node.Parent.Parent.IsKind(SyntaxKind.EventFieldDeclaration);

case SyntaxKind.FieldDeclaration:
case SyntaxKind.MethodDeclaration:
case SyntaxKind.PropertyDeclaration:
case SyntaxKind.GetAccessorDeclaration:
case SyntaxKind.SetAccessorDeclaration:
case SyntaxKind.EventDeclaration:
case SyntaxKind.EventFieldDeclaration:
case SyntaxKind.AddAccessorDeclaration:
case SyntaxKind.RemoveAccessorDeclaration:
case SyntaxKind.IndexerDeclaration:
case SyntaxKind.OperatorDeclaration:
case SyntaxKind.ConversionOperatorDeclaration:
case SyntaxKind.ConstructorDeclaration:
case SyntaxKind.DestructorDeclaration:
return true;

default:
return false;
}
_ = node;
return true;
}

public bool IsDeclaration(SyntaxNode node)
Expand Down