public override SyntaxNode VisitIdentifierName(IdentifierNameSyntax node) { if (IsReference(node)) { var assignmentExpression = node.Parent as AssignmentExpressionSyntax; if (assignmentExpression != null) { if (assignmentExpression.IsCompoundAssignExpression() && assignmentExpression.Left == node) { return node.Update(node.Identifier.WithAdditionalAnnotations(CreateConflictAnnotation())); } } } return base.VisitIdentifierName(node); }
public override SyntaxNode VisitIdentifierName(IdentifierNameSyntax node) { _cancellationToken.ThrowIfCancellationRequested(); if (IsReference(node)) { if (HasConflict(node, _variableDeclarator)) { return node.Update(node.Identifier.WithAdditionalAnnotations(CreateConflictAnnotation())); } return _expressionToInline .Parenthesize() .WithAdditionalAnnotations(Formatter.Annotation, Simplifier.Annotation); } return base.VisitIdentifierName(node); }