protected override async Task<EvaluationResult> EvaluateImpl(SyntaxNode node, SemanticModel semanticModel, Solution solution)
{
var referenceTasks = GetSymbols(node, semanticModel)
.Select(solution.FindReferences);
var references = (await Task.WhenAll(referenceTasks).ConfigureAwait(false))
.SelectMany(x => x.Locations)
.Select(x => x.Location.SourceTree.GetRoot().FindToken(x.Location.SourceSpan.Start))
.Select(x => x.Parent)
.Where(x => x != null)
.Select(x => new { Value = x, Parent = x.Parent })
.Where(x => IsNotAssignment(x.Parent, x.Value))
.AsArray();
if (!references.Any())
{
return new EvaluationResult
{
Snippet = node.ToFullString()
};
}
return null;
}