public StreamingFindReferencesProgressAdapter(IFindReferencesProgress progress)
 {
     _progress       = progress;
     ProgressTracker = new StreamingProgressTracker((current, max) =>
     {
         _progress.ReportProgress(current, max);
         return(default);
Example #2
0
 public StreamingFindReferencesProgressAdapter(IFindReferencesProgress progress)
 {
     _progress            = progress;
     this.ProgressTracker = new StreamingProgressTracker((current, max) =>
     {
         _progress.ReportProgress(current, max);
         return(Task.CompletedTask);
     });
 }
Example #3
0
        public async Task <IEnumerable <ReferencedSymbol> > FindReferencesAsync(ISymbol symbol)
        {
            progress.OnStarted();
            progress.ReportProgress(0, 1);
            try
            {
                var symbols = await DetermineAllSymbolsAsync(symbol).ConfigureAwait(false);

                var projectMap = await CreateProjectMapAsync(symbols).ConfigureAwait(false);

                var documentMap = await CreateDocumentMapAsync(projectMap).ConfigureAwait(false);
                await ProcessAsync(documentMap).ConfigureAwait(false);
            }
            finally
            {
                progress.ReportProgress(1, 1);
                progress.OnCompleted();
            }

            return(this.foundReferences.Select(kvp => new ReferencedSymbol(kvp.Key, kvp.Value.ToImmutableArray())).ToImmutableArray());
        }
Example #4
0
 public Task ReportProgressAsync(int current, int maximum)
 {
     _progress.ReportProgress(current, maximum);
     return(SpecializedTasks.EmptyTask);
 }
 public Task ReportProgressAsync(int current, int maximum)
 {
     _progress.ReportProgress(current, maximum);
     return(Task.CompletedTask);
 }
            public void Increment()
            {
                var result = Interlocked.Increment(ref current);

                progress.ReportProgress(current, maximum);
            }