private DiagnosticsUpdatedArgs MakeArgs(DiagnosticAnalyzer analyzer, ImmutableHashSet <DiagnosticData> items, Project project)
        {
            var id = WorkspaceAnalyzerManager.GetUniqueIdForAnalyzer(analyzer);

            return(new DiagnosticsUpdatedArgs(
                       id: Tuple.Create(this, id, project?.Id),
                       workspace: this.Workspace,
                       solution: project?.Solution,
                       projectId: project?.Id,
                       documentId: null,
                       diagnostics: items.ToImmutableArray()));
        }
            public IncrementalAnalyzerDelegatee(DiagnosticAnalyzerService owner, Workspace workspace, WorkspaceAnalyzerManager workspaceAnalyzerManager, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
                : base(workspace, hostDiagnosticUpdateSource)
            {
                _workspaceAnalyzerManager = workspaceAnalyzerManager;
                _owner = owner;

                var v1CorrelationId = LogAggregator.GetNextId();

                _engineV1 = new EngineV1.DiagnosticIncrementalAnalyzer(_owner, v1CorrelationId, workspace, _workspaceAnalyzerManager, hostDiagnosticUpdateSource);

                var v2CorrelationId = LogAggregator.GetNextId();

                _engineV2 = new EngineV2.DiagnosticIncrementalAnalyzer(_owner, v2CorrelationId, workspace, _workspaceAnalyzerManager, hostDiagnosticUpdateSource);
            }
 // internal for testing purposes.
 internal DiagnosticAnalyzerService(ImmutableArray <AnalyzerReference> workspaceAnalyzers, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource = null) : this()
 {
     _workspaceAnalyzerManager   = new WorkspaceAnalyzerManager(workspaceAnalyzers, hostDiagnosticUpdateSource);
     _hostDiagnosticUpdateSource = hostDiagnosticUpdateSource;
 }
 private DiagnosticAnalyzerService(IEnumerable <string> workspaceAnalyzerAssemblies, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource) : this()
 {
     _workspaceAnalyzerManager   = new WorkspaceAnalyzerManager(workspaceAnalyzerAssemblies, hostDiagnosticUpdateSource);
     _hostDiagnosticUpdateSource = hostDiagnosticUpdateSource;
 }