CodeAnalysisForCSharp6.SolutionLoader.GetSyntaxTrees C# (CSharp) Method

GetSyntaxTrees() private method

private GetSyntaxTrees ( Microsoft.CodeAnalysis.Solution solution ) : IEnumerable
solution Microsoft.CodeAnalysis.Solution
return IEnumerable
        private IEnumerable<SyntaxTree> GetSyntaxTrees(Solution solution)
        {
            foreach (var project in solution.Projects)
            {
                foreach (var doc in project.Documents)
                {
                    var ext = Path.GetExtension(doc.FilePath);
                    if (ext == ".cs")
                    {
                        var text = File.ReadAllText(doc.FilePath);
                        yield return CSharpSyntaxTree.ParseText(SourceText.From(text));
                    }
                }
            }
        }
    }