private void UpdateAnalyzerTelemetryData(ImmutableDictionary <DiagnosticAnalyzer, AnalyzerTelemetryInfo> telemetry)
 {
     foreach (var(analyzer, telemetryInfo) in telemetry)
     {
         DiagnosticLogAggregator.UpdateAnalyzerTypeCount(analyzer, telemetryInfo);
     }
 }
Exemple #2
0
        public override void LogAnalyzerCountSummary()
        {
            DiagnosticAnalyzerLogger.LogAnalyzerCrashCountSummary(_correlationId, _diagnosticLogAggregator);
            DiagnosticAnalyzerLogger.LogAnalyzerTypeCountSummary(_correlationId, _diagnosticLogAggregator);

            // reset the log aggregator
            _diagnosticLogAggregator = new DiagnosticLogAggregator(_owner);
        }
Exemple #3
0
        public DiagnosticIncrementalAnalyzer(DiagnosticAnalyzerService owner, int correlationId, Workspace workspace, AnalyzerManager analyzerManager)
        {
            _owner             = owner;
            _correlationId     = correlationId;
            _memberRangeMap    = new MemberRangeMap();
            _analyzersAndState = new DiagnosticAnalyzersAndStates(this, workspace, analyzerManager);
            _executor          = new AnalyzerExecutor(this);

            _diagnosticLogAggregator = new DiagnosticLogAggregator(_owner);
        }
Exemple #4
0
        public DiagnosticIncrementalAnalyzer(
            DiagnosticAnalyzerService owner,
            int correlationId,
            Workspace workspace,
            WorkspaceAnalyzerManager workspaceAnalyzerManager,
            AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
            : base(workspace, hostDiagnosticUpdateSource)
        {
            _owner             = owner;
            _correlationId     = correlationId;
            _memberRangeMap    = new MemberRangeMap();
            _analyzersAndState = new DiagnosticAnalyzersAndStates(this, workspace, workspaceAnalyzerManager);
            _executor          = new AnalyzerExecutor(this);

            _diagnosticLogAggregator = new DiagnosticLogAggregator(_owner);
        }
Exemple #5
0
        public DiagnosticIncrementalAnalyzer(
            DiagnosticAnalyzerService owner,
            int correlationId,
            Workspace workspace,
            HostAnalyzerManager analyzerManager,
            AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
            : base(workspace, hostDiagnosticUpdateSource)
        {
            _owner          = owner;
            _correlationId  = correlationId;
            _memberRangeMap = new MemberRangeMap();
            _executor       = new AnalyzerExecutor(this);
            _eventQueue     = new SimpleTaskQueue(TaskScheduler.Default);

            _stateManger = new StateManager(analyzerManager);
            _stateManger.ProjectAnalyzerReferenceChanged += OnProjectAnalyzerReferenceChanged;

            _diagnosticLogAggregator = new DiagnosticLogAggregator(_owner);
        }
Exemple #6
0
        public DiagnosticIncrementalAnalyzer(
            DiagnosticAnalyzerService owner,
            int correlationId,
            Workspace workspace,
            HostAnalyzerManager hostAnalyzerManager,
            AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
        {
            Contract.ThrowIfNull(owner);

            Owner                      = owner;
            Workspace                  = workspace;
            HostAnalyzerManager        = hostAnalyzerManager;
            HostDiagnosticUpdateSource = hostDiagnosticUpdateSource;
            DiagnosticLogAggregator    = new DiagnosticLogAggregator(owner);

            _correlationId = correlationId;

            _stateManager = new StateManager(hostAnalyzerManager);
            _stateManager.ProjectAnalyzerReferenceChanged += OnProjectAnalyzerReferenceChanged;

            _executor           = new Executor(this);
            _compilationManager = new CompilationManager(this);
        }
        public DiagnosticIncrementalAnalyzer(
            DiagnosticAnalyzerService analyzerService,
            int correlationId,
            Workspace workspace,
            DiagnosticAnalyzerInfoCache analyzerInfoCache,
            AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
        {
            Contract.ThrowIfNull(analyzerService);

            AnalyzerService             = analyzerService;
            Workspace                   = workspace;
            DiagnosticAnalyzerInfoCache = analyzerInfoCache;
            HostDiagnosticUpdateSource  = hostDiagnosticUpdateSource;
            DiagnosticLogAggregator     = new DiagnosticLogAggregator(analyzerService);

            _correlationId = correlationId;

            _stateManager = new StateManager(analyzerInfoCache);
            _stateManager.ProjectAnalyzerReferenceChanged += OnProjectAnalyzerReferenceChanged;

            _diagnosticAnalyzerRunner         = new InProcOrRemoteHostAnalyzerRunner(AnalyzerService, HostDiagnosticUpdateSource);
            _projectCompilationsWithAnalyzers = new ConditionalWeakTable <Project, CompilationWithAnalyzers?>();
        }
 protected void ResetDiagnosticLogAggregator()
 {
     DiagnosticLogAggregator = new DiagnosticLogAggregator(Owner);
 }
Exemple #9
0
 private void ResetDiagnosticLogAggregator()
 {
     DiagnosticLogAggregator = new DiagnosticLogAggregator(AnalyzerService);
 }
 private void ResetDiagnosticLogAggregator()
 {
     DiagnosticLogAggregator = new DiagnosticLogAggregator(Owner);
 }
Exemple #11
0
        // virtual for testing purposes.
        internal virtual Action <Exception, DiagnosticAnalyzer, Diagnostic> GetOnAnalyzerException(ProjectId projectId, DiagnosticLogAggregator logAggregatorOpt)
        {
            return((ex, analyzer, diagnostic) =>
            {
                // Log telemetry, if analyzer supports telemetry.
                DiagnosticAnalyzerLogger.LogAnalyzerCrashCount(analyzer, ex, logAggregatorOpt);

                AnalyzerHelper.OnAnalyzerException_NoTelemetryLogging(ex, analyzer, diagnostic, _hostDiagnosticUpdateSource, projectId);
            });
        }
 internal override Action<Exception, DiagnosticAnalyzer, Diagnostic> GetOnAnalyzerException(ProjectId projectId, DiagnosticLogAggregator diagnosticLogAggregator)
 {
     return _onAnalyzerException ?? base.GetOnAnalyzerException(projectId, diagnosticLogAggregator);
 }