protected bool IsTrackedVariableDeclaration(TExpressionSyntax expression, SyntaxBaseContext context) { var node = expression; while (node is TIdentifierNameSyntax identifierNameSyntax) { var identifierName = Language.Syntax.NodeIdentifier(identifierNameSyntax).Value.ValueText; node = Language.AssignmentFinder.FindLinearPrecedingAssignmentExpression(identifierName, node) as TExpressionSyntax; var location = SecondaryLocationForExpression(node, identifierName, out var foundName); if (IsSensitiveExpression(node, context.SemanticModel)) { context.AddSecondaryLocation(location, AssignmentWithFormattingMessage, foundName); return(true); } else { context.AddSecondaryLocation(location, AssignmentMessage, foundName); } } return(false); }
protected abstract bool IsTracked(TExpressionSyntax expression, SyntaxBaseContext context);