Closed LWehmschulteAtRosenxt closed 1 week ago
This is by design. The following is legal/expected in C#:
public event Action a, b, c;
The declaring syntax reference points to the respective variabledeclarators for a
, b
, or c
to uniquely identify them.
When I declare the event with the add/remove body, the syntax is a EventDeclarationSyntax:
Right, in this form, you can only have one event, so the entire declaration is returned.
This is the same with fields versus properties. Fields give you back the variable declarators. Properties give back the full declaration.
Version Used: Microsoft.CodeAnalysis.CSharp" Version="4.9.2" Microsoft.CodeAnalysis.Analyzers" Version="3.3.4"
Steps to Reproduce:
Expected Behavior: The syntax variable should be of type
EventDeclarationSyntax
Actual Behavior: See the syntax variable is of type
VariableDeclaratorSyntax
and not of typeEventDeclarationSyntax
Additional info When I declare the event with the add/remove body, the syntax is a
EventDeclarationSyntax
: