-
Notifications
You must be signed in to change notification settings - Fork 232
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
Rule S6613: Implement CodeFix #7250
Conversation
var diagnosticSpan = diagnostic.Location.SourceSpan; | ||
|
||
if (root.FindNode(diagnosticSpan, getInnermostNodeForTie: true) is IdentifierNameSyntax identifierSyntax | ||
&& identifierSyntax is { Parent: ExpressionSyntax { Parent: InvocationExpressionSyntax invocationExpression } expression }) |
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.
Parent ExpressionSyntax
will cover both SimpleMemberAccessExpression
for simple invocations and MemberBindingExpression
for conditional expressions.
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.
It looks good to me. I've added a few pedantic comments that are optional and a question to better understand why some of the test cases were changed.
analyzers/src/SonarAnalyzer.CSharp/Rules/LinkedListPropertiesInsteadOfMethodsCodeFix.cs
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.CSharp/Rules/LinkedListPropertiesInsteadOfMethodsCodeFix.cs
Outdated
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.CSharp/Rules/LinkedListPropertiesInsteadOfMethodsCodeFix.cs
Outdated
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.CSharp/Rules/LinkedListPropertiesInsteadOfMethodsCodeFix.cs
Show resolved
Hide resolved
analyzers/tests/SonarAnalyzer.UnitTest/TestCases/LinkedListPropertiesInsteadOfMethods.cs
Show resolved
Hide resolved
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.
LGTM!
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.
LGTM! The failing test seems to be related to other changes and not this PR. Can you please check before merging?
f36fb2d
to
bb730d2
Compare
Kudos, SonarCloud Quality Gate passed! |
SonarCloud Quality Gate failed. |
Fixes #7239
RSPEC PR: SonarSource/rspec#1953