ArchiMetrics.Analysis.ReferenceResolvers.SymbolReferenceResolver.Resolve C# (CSharp) Méthode

Resolve() public static méthode

public static Resolve ( this compilation, Microsoft.CodeAnalysis.SyntaxNode root ) : ReferenceLocation>>.IEnumerable
compilation this
root Microsoft.CodeAnalysis.SyntaxNode
Résultat ReferenceLocation>>.IEnumerable
		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;
		}