private static void SortExpressions(SemanticModel model, BinaryExpressionSyntax expr, out ExpressionSyntax tagExpression, out ExpressionSyntax otherExpression) { if (TagComparisonAnalyzer.IsReportableExpression(model, expr.Right)) { tagExpression = expr.Right; otherExpression = expr.Left; } else { tagExpression = expr.Left; otherExpression = expr.Right; } }
private static void SortExpressions(SemanticModel model, InvocationExpressionSyntax expr, out ExpressionSyntax tagExpression, out ExpressionSyntax otherExpression) { if (expr.Expression is MemberAccessExpressionSyntax mae && expr.ArgumentList.Arguments.Count == 1) { if (TagComparisonAnalyzer.IsReportableExpression(model, mae.Expression)) { tagExpression = mae.Expression; otherExpression = expr.ArgumentList.Arguments.First().Expression; } else { tagExpression = FindReportableExpression(model, expr.ArgumentList); otherExpression = mae.Expression; } }