private void SetGlobalContext(int uiCultureLCID, int cultureLCID, string?serializedSession) { // set global telemetry session var session = GetTelemetrySession(serializedSession); if (session == null) { return; } EnsureCulture(uiCultureLCID, cultureLCID); // set roslyn loggers RoslynServices.SetTelemetrySession(session); RoslynLogger.SetLogger(AggregateLogger.Create(new VSTelemetryLogger(session), RoslynLogger.GetLogger())); // set both handler as NFW FatalError.Handler = ex => WatsonReporter.Report(ex, WatsonSeverity.Critical); FatalError.NonFatalHandler = ex => WatsonReporter.Report(ex); // start performance reporter var diagnosticAnalyzerPerformanceTracker = SolutionService.PrimaryWorkspace.Services.GetService <IPerformanceTrackerService>(); if (diagnosticAnalyzerPerformanceTracker != null) { var globalOperationNotificationService = SolutionService.PrimaryWorkspace.Services.GetService <IGlobalOperationNotificationService>(); _performanceReporter = new PerformanceReporter(Logger, diagnosticAnalyzerPerformanceTracker, globalOperationNotificationService, s_reportInterval, _shutdownCancellationSource.Token); } }
private void SetGlobalContext(int uiCultureLCID, int cultureLCID, string serializedSession) { var session = new TelemetrySession(serializedSession); session.Start(); EnsureCulture(uiCultureLCID, cultureLCID); WatsonReporter.InitializeFatalErrorHandlers(session); WatsonReporter.InitializeLogger(Logger); // set roslyn loggers RoslynServices.SetTelemetrySession(session); RoslynLogger.SetLogger(AggregateLogger.Create(new VSTelemetryLogger(session), RoslynLogger.GetLogger())); // start performance reporter var diagnosticAnalyzerPerformanceTracker = SolutionService.PrimaryWorkspace.Services.GetService <IPerformanceTrackerService>(); if (diagnosticAnalyzerPerformanceTracker != null) { var globalOperationNotificationService = SolutionService.PrimaryWorkspace.Services.GetService <IGlobalOperationNotificationService>(); _performanceReporter = new PerformanceReporter(Logger, diagnosticAnalyzerPerformanceTracker, globalOperationNotificationService, s_reportInterval, _shutdownCancellationSource.Token); } }
protected Task <Solution> GetSolutionAsync(PinnedSolutionInfo solutionInfo, CancellationToken cancellationToken) { var localRoslynService = new RoslynServices(solutionInfo.ScopeId, AssetStorage); return(GetSolutionAsync(localRoslynService, solutionInfo, cancellationToken)); }
private static Task <Solution> GetSolutionAsync(RoslynServices roslynService, PinnedSolutionInfo solutionInfo, CancellationToken cancellationToken) { var solutionController = (ISolutionController)roslynService.SolutionService; return(solutionController.GetSolutionAsync(solutionInfo.SolutionChecksum, solutionInfo.FromPrimaryBranch, cancellationToken)); }
public virtual void Initialize(PinnedSolutionInfo info) { // set pinned solution info _lazyRoslynServices = null; _solutionInfo = info; }
public TestAccessor(RoslynServices roslynServices) { _roslynServices = roslynServices; }