Ejemplo n.º 1
0
 public InProcOrRemoteHostAnalyzerRunner(
     DiagnosticAnalyzerInfoCache analyzerInfoCache,
     IAsynchronousOperationListener?operationListener = null)
 {
     AnalyzerInfoCache       = analyzerInfoCache;
     _asyncOperationListener = operationListener ?? AsynchronousOperationListenerProvider.NullListener;
 }
Ejemplo n.º 2
0
 public InProcOrRemoteHostAnalyzerRunner(
     DiagnosticAnalyzerInfoCache analyzerInfoCache,
     Workspace workspace,
     IAsynchronousOperationListener?operationListener = null)
 {
     AnalyzerInfoCache        = analyzerInfoCache;
     _asyncOperationListener  = operationListener ?? AsynchronousOperationListenerProvider.NullListener;
     _documentTrackingService = workspace.Services.GetService <IDocumentTrackingService>();
 }
Ejemplo n.º 3
0
 protected DiagnosticAnalyzerService(
     DiagnosticAnalyzerInfoCache analyzerInfoCache,
     AbstractHostDiagnosticUpdateSource?hostDiagnosticUpdateSource,
     IDiagnosticUpdateSourceRegistrationService registrationService,
     IAsynchronousOperationListener?listener = null)
     : this(registrationService)
 {
     _analyzerInfoCache          = analyzerInfoCache;
     _hostDiagnosticUpdateSource = hostDiagnosticUpdateSource;
     Listener = listener ?? AsynchronousOperationListenerProvider.NullListener;
 }
Ejemplo n.º 4
0
 protected DiagnosticAnalyzerService(
     Lazy <ImmutableArray <HostDiagnosticAnalyzerPackage> > workspaceAnalyzerPackages,
     IAnalyzerAssemblyLoader?hostAnalyzerAssemblyLoader,
     AbstractHostDiagnosticUpdateSource?hostDiagnosticUpdateSource,
     PrimaryWorkspace primaryWorkspace,
     IDiagnosticUpdateSourceRegistrationService registrationService,
     IAsynchronousOperationListener?listener = null)
     : this(new DiagnosticAnalyzerInfoCache(workspaceAnalyzerPackages, hostAnalyzerAssemblyLoader, hostDiagnosticUpdateSource, primaryWorkspace),
            hostDiagnosticUpdateSource,
            registrationService,
            listener)
 {
 }
 public IntellisenseQuickInfoBuilderContext(
     Document document,
     IThreadingContext?threadingContext,
     IUIThreadOperationExecutor?operationExecutor,
     IAsynchronousOperationListener?asynchronousOperationListener,
     Lazy <IStreamingFindUsagesPresenter>?streamingPresenter)
 {
     Document                      = document;
     ThreadingContext              = threadingContext;
     OperationExecutor             = operationExecutor;
     StreamingPresenter            = streamingPresenter;
     AsynchronousOperationListener = asynchronousOperationListener;
 }
        public AsyncBatchingWorkQueue(
            TimeSpan delay,
            Func <ImmutableArray <TItem>, CancellationToken, Task> processBatchAsync,
            IEqualityComparer <TItem>?equalityComparer,
            IAsynchronousOperationListener?asyncListener,
            CancellationToken cancellationToken)
        {
            _delay             = delay;
            _processBatchAsync = processBatchAsync;
            _equalityComparer  = equalityComparer;
            _asyncListener     = asyncListener;
            _cancellationToken = cancellationToken;

            _uniqueItems = new HashSet <TItem>(equalityComparer);
        }
Ejemplo n.º 7
0
        protected DiagnosticAnalyzerService(
            IDiagnosticUpdateSourceRegistrationService registrationService,
            IAsynchronousOperationListener?listener)
        {
            AnalyzerInfoCache = new DiagnosticAnalyzerInfoCache();
            Listener          = listener ?? AsynchronousOperationListenerProvider.NullListener;

            _map = new ConditionalWeakTable <Workspace, DiagnosticIncrementalAnalyzer>();
            _createIncrementalAnalyzer = CreateIncrementalAnalyzerCallback;
            _eventMap = new EventMap();

            _eventQueue = new TaskQueue(Listener, TaskScheduler.Default);

            registrationService.Register(this);
        }
Ejemplo n.º 8
0
        public AsyncBatchingDelay(
            TimeSpan delay,
            Func <CancellationToken, Task> processAsync,
            IAsynchronousOperationListener?asyncListener,
            CancellationToken cancellationToken)
        {
            _processAsync = processAsync;

            // We use an AsyncBatchingWorkQueue with a boolean, and just always add the
            // same value at all times.
            _workQueue = new AsyncBatchingWorkQueue <bool>(
                delay,
                OnNotifyAsync,
                equalityComparer: EqualityComparer <bool> .Default,
                asyncListener,
                cancellationToken);
        }
Ejemplo n.º 9
0
        protected DiagnosticAnalyzerService(
            IDiagnosticUpdateSourceRegistrationService registrationService,
            IAsynchronousOperationListener?listener)
        {
            AnalyzerInfoCache = new DiagnosticAnalyzerInfoCache();
            Listener          = listener ?? AsynchronousOperationListenerProvider.NullListener;

            _map = new ConditionalWeakTable <Workspace, DiagnosticIncrementalAnalyzer>();
            _createIncrementalAnalyzer = CreateIncrementalAnalyzerCallback;
            _eventMap = new EventMap();

            // use diagnostic event task scheduler so that we never flood async events queue with million of events.
            // queue itself can handle huge number of events but we are seeing OOM due to captured data in pending events.
            _eventQueue = new TaskQueue(Listener, s_eventScheduler);

            registrationService.Register(this);
        }