public static ResourceAncestorGraph Compute(SyntaxTree syntaxTree, IBinder binder) { var visitor = new ResourceAncestorVisitor(binder); visitor.Visit(syntaxTree.ProgramSyntax); return(new ResourceAncestorGraph(visitor.Ancestry)); }
public static ResourceAncestorGraph Compute(SemanticModel semanticModel) { var visitor = new ResourceAncestorVisitor(semanticModel); visitor.Visit(semanticModel.SourceFile.ProgramSyntax); var ancestry = visitor.Ancestry.Keys .ToImmutableDictionary( child => child, child => GetAncestorsYoungestToOldest(visitor.Ancestry, child).Reverse().ToImmutableArray()); return(new ResourceAncestorGraph(ancestry)); }
public static ResourceAncestorGraph Compute(SyntaxTree syntaxTree, IBinder binder) { var visitor = new ResourceAncestorVisitor(binder); visitor.Visit(syntaxTree.ProgramSyntax); var ancestry = visitor.Ancestry.Keys .ToImmutableDictionary( child => child, child => GetAncestorsYoungestToOldest(visitor.Ancestry, child).Reverse().ToImmutableArray()); return(new ResourceAncestorGraph(ancestry)); }