public static IEnumerable<IGrouping<ISymbol, ReferenceLocation>> Resolve(this Compilation compilation, SyntaxNode root)
{
var model = compilation.GetSemanticModel(root.SyntaxTree);
var fields = root.DescendantNodes()
.Select(
descendant =>
{
var symbol = model.GetSymbolInfo(descendant);
return new KeyValuePair<ISymbol, SyntaxNode>(symbol.Symbol, descendant);
})
.Where(x => x.Key != null)
.SelectMany(x => GetSymbolDetails(x, model))
.GroupBy(x => x.Symbol, x => x.Location);
var array = fields.AsArray();
return array;
}