Example #1
0
 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>();
Example #2
0
 private static IEnumerable <ProjectAnalyzer> GetReferencedAnalyzerProjects(ProjectAnalyzer analyzer) =>
 analyzer.GetProjectReferences()
 ?.Select(x => analyzer.Manager.Projects.TryGetValue(x, out ProjectAnalyzer a) ? a : null)