Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 0 additions & 10 deletions analyzers/its/expected/BlazorSample/S6966-BlazorSample-net7.0.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions analyzers/its/expected/RazorSample/S6966-RazorSample-net7.0.json

This file was deleted.

This file was deleted.

70 changes: 0 additions & 70 deletions analyzers/rspec/cs/S6966.html

This file was deleted.

23 changes: 0 additions & 23 deletions analyzers/rspec/cs/S6966.json

This file was deleted.

2 changes: 1 addition & 1 deletion analyzers/rspec/cs/Sonar_way_profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,6 @@
"S6930",
"S6931",
"S6934",
"S6966"
"S6961"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,5 @@ public static bool TryGetExpressionComparedToNull(this ExpressionSyntax expressi

return false;
}

/// <summary>
/// Returns the expression, representing the left side of the dot. This is useful for finding the expression of an invoked expression. <br/>
/// For the expression of the invocation <c>M()</c> in the expression <c>this.A.B.M()</c> the member access <c>this.A.B</c> is returned and <br/>
/// for <c>this.A?.B?.M()</c> the member binding <c>.B</c> is returned.
/// </summary>
/// <param name="expression">The expression to start the search of. Should be an MemberAccess or a MemberBinding.</param>
/// <returns>The expression left of the dot or question mark dot.</returns>
public static ExpressionSyntax GetLeftOfDot(this ExpressionSyntax expression) =>
expression switch
{
MemberAccessExpressionSyntax memberAccessExpression => memberAccessExpression.Expression,
MemberBindingExpressionSyntax memberBindingExpression => memberBindingExpression.GetParentConditionalAccessExpression()?.Expression,
_ => null,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,18 @@ public static partial class SyntaxNodeExtensions
SyntaxKind.AddAccessorDeclaration,
SyntaxKind.AnonymousMethodExpression,
SyntaxKind.BaseConstructorInitializer,
SyntaxKind.CompilationUnit,
SyntaxKind.ConstructorDeclaration,
SyntaxKind.ConversionOperatorDeclaration,
SyntaxKind.DestructorDeclaration,
SyntaxKind.EnumMemberDeclaration,
SyntaxKind.FieldDeclaration,
SyntaxKind.EqualsValueClause,
SyntaxKind.GetAccessorDeclaration,
SyntaxKind.GlobalStatement,
SyntaxKindEx.InitAccessorDeclaration,
SyntaxKindEx.LocalFunctionStatement,
SyntaxKind.MethodDeclaration,
SyntaxKind.OperatorDeclaration,
SyntaxKind.Parameter,
SyntaxKind.ParenthesizedLambdaExpression,
SyntaxKindEx.PrimaryConstructorBaseType,
SyntaxKind.PropertyDeclaration,
SyntaxKind.RemoveAccessorDeclaration,
SyntaxKind.SetAccessorDeclaration,
SyntaxKind.SimpleLambdaExpression,
Expand Down
Loading