private static IEnumerable <ProjectAnalyzer> GetReferencedAnalyzerProjects(ProjectAnalyzer analyzer) => analyzer.GetProjectReferences() ?.Select(x => analyzer.Manager.Projects.TryGetValue(x, out ProjectAnalyzer a) ? a : null)
private static IEnumerable <ProjectReference> GetExistingProjectReferences(ProjectAnalyzer analyzer, AdhocWorkspace workspace) => analyzer.GetProjectReferences() ?.Select(x => workspace.CurrentSolution.Projects.FirstOrDefault(y => y.FilePath == x)) .Where(x => x != null) .Select(x => new ProjectReference(x.Id)) ?? Array.Empty <ProjectReference>();