public async Task FindReferencesAsync(ISymbol symbol, CancellationToken cancellationToken) { await _progress.OnStartedAsync(cancellationToken).ConfigureAwait(false); try { await using var _ = await _progressTracker.AddSingleItemAsync(cancellationToken).ConfigureAwait(false); // For the starting symbol, always cascade up and down the inheritance hierarchy. var symbols = await DetermineAllSymbolsAsync( symbol, FindReferencesCascadeDirection.UpAndDown, cancellationToken).ConfigureAwait(false); var projectMap = await CreateProjectMapAsync(symbols, cancellationToken).ConfigureAwait(false); var projectToDocumentMap = await CreateProjectToDocumentMapAsync(projectMap, cancellationToken).ConfigureAwait(false); ValidateProjectToDocumentMap(projectToDocumentMap); await ProcessAsync(projectToDocumentMap, cancellationToken).ConfigureAwait(false); } finally { await _progress.OnCompletedAsync(cancellationToken).ConfigureAwait(false); } }
public async Task FindReferencesAsync() { await using var _ = await _progressTracker.AddSingleItemAsync().ConfigureAwait(false); if (_searchKind != SearchKind.None) { await FindReferencesWorkerAsync().ConfigureAwait(false); } }
public async Task FindReferencesAsync(CancellationToken cancellationToken) { var disposable = await _progressTracker.AddSingleItemAsync(cancellationToken).ConfigureAwait(false); await using var _ = disposable.ConfigureAwait(false); if (_searchKind != SearchKind.None) { await FindReferencesWorkerAsync(cancellationToken).ConfigureAwait(false); } }
private async Task <ImmutableArray <ExternalReferenceItem> > FindReferencesByMonikerAsync( ICodeIndexProvider codeIndexProvider, DefinitionItem definition, ImmutableArray <ISymbolMoniker> monikers, IStreamingProgressTracker progress, int pageIndex, CancellationToken cancellationToken) { // Let the find-refs window know we have outstanding work await using var _1 = await progress.AddSingleItemAsync().ConfigureAwait(false); var results = await FindReferencesByMonikerAsync( codeIndexProvider, monikers, pageIndex, cancellationToken).ConfigureAwait(false); using var _2 = ArrayBuilder <ExternalReferenceItem> .GetInstance(out var referenceItems); foreach (var result in results) { referenceItems.Add(ConvertResult(definition, result)); } return(referenceItems.ToImmutable()); }
public async Task FindReferencesAsync(ISymbol symbol) { await _progress.OnStartedAsync().ConfigureAwait(false); try { await using var _ = await _progressTracker.AddSingleItemAsync().ConfigureAwait(false); var symbols = await DetermineAllSymbolsAsync(symbol).ConfigureAwait(false); var projectMap = await CreateProjectMapAsync(symbols).ConfigureAwait(false); var projectToDocumentMap = await CreateProjectToDocumentMapAsync(projectMap).ConfigureAwait(false); ValidateProjectToDocumentMap(projectToDocumentMap); await ProcessAsync(projectToDocumentMap).ConfigureAwait(false); } finally { await _progress.OnCompletedAsync().ConfigureAwait(false); } }