-
Notifications
You must be signed in to change notification settings - Fork 231
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
Fix S4529: Should not highlight constructors, properties and methods with NonActionAttribute #2109
Conversation
…with NonActionAttribute
0cb5f00
to
148f20b
Compare
); | ||
KnownType.System_Web_Mvc_Controller); | ||
|
||
private static readonly ImmutableArray<KnownType> nonactionTypes = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[minor] The a
should be uppercase (i.e. nonActionTypes
)
@@ -44,6 +49,8 @@ public static class AspNetMvcHelper | |||
/// </summary> | |||
public static bool IsControllerMethod(this IMethodSymbol methodSymbol) => | |||
methodSymbol.GetEffectiveAccessibility() == Accessibility.Public && | |||
methodSymbol.MethodKind == MethodKind.Ordinary && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would put this line before the effective accessibility check as it is simpler (faster).
} | ||
|
||
[DataTestMethod] | ||
[DataRow("3.0.20105.1")] | ||
[DataRow("2.1.3")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain why you did this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test is for ASP.NET MVC Core (the attributes are not present in the desktop version of ASP.NET MVC)
get { return 0; } | ||
set { } | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test with an event, an operator and a destructor.
Set(ByVal value As Integer) | ||
End Set | ||
End Property | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as for C#.
…with NonActionAttribute (#2109)
…with NonActionAttribute (#2109)
…with NonActionAttribute (#2109)
Fix #1991