public static ISet <ITypeSymbol> GetDependentTypes(Compilation compilation, SyntaxNode methodBody) { ShaderSyntaxCollector syntaxCollector = new ShaderSyntaxCollector(compilation); syntaxCollector.Visit(methodBody); return(syntaxCollector.CollectedTypes); }
public static IList <Type> GetDependentTypes(MethodInfo methodInfo) { Compilation compilation = GetCompilation(methodInfo.DeclaringType); MethodDeclarationSyntax methodNode = GetMethodDeclaration(methodInfo, compilation.SyntaxTrees.Single()); ShaderSyntaxCollector syntaxCollector = new ShaderSyntaxCollector(compilation); syntaxCollector.Visit(methodNode.Body); return(syntaxCollector.CollectedTypes.Distinct().ToList()); }