public async ValueTask OnReferenceFoundAsync(
                SerializableSymbolAndProjectId definition, SerializableReferenceLocation reference)
            {
                ISymbol symbol;

                lock (_gate)
                {
                    // The definition may not be in the map if we failed to map it over using TryRehydrateAsync in OnDefinitionFoundAsync.
                    // Just ignore this reference.  Note: while this is a degraded experience:
                    //
                    // 1. TryRehydrateAsync logs an NFE so we can track down while we're failing to roundtrip the
                    //    definition so we can track down that issue.
                    // 2. NFE'ing and failing to show a result, is much better than NFE'ing and then crashing
                    //    immediately afterwards.
                    if (!_definitionMap.TryGetValue(definition, out symbol))
                    {
                        return;
                    }
                }

                var referenceLocation = await reference.RehydrateAsync(
                    _solution, _cancellationToken).ConfigureAwait(false);

                await _progress.OnReferenceFoundAsync(symbol, referenceLocation).ConfigureAwait(false);
            }
Пример #2
0
        public Task OnReferenceFoundAsync(SymbolAndProjectId definition, ReferenceLocation location)
        {
            lock (_gate)
            {
                _symbolToLocations[definition].Add(location);
            }

            return(_underlyingProgress.OnReferenceFoundAsync(definition, location));
        }
Пример #3
0
            public async Task OnReferenceFoundAsync(
                SerializableSymbolAndProjectId definition, SerializableReferenceLocation reference)
            {
                var symbolAndProjectId = await definition.RehydrateAsync(
                    _solution, _cancellationToken).ConfigureAwait(false);

                var referenceLocation = await reference.RehydrateAsync(
                    _solution, _cancellationToken).ConfigureAwait(false);

                await _progress.OnReferenceFoundAsync(symbolAndProjectId, referenceLocation).ConfigureAwait(false);
            }
            public async Task OnReferenceFoundAsync(
                SerializableSymbolAndProjectId definition, SerializableReferenceLocation reference)
            {
                ISymbol symbol;

                lock (_gate)
                {
                    symbol = _definitionMap[definition];
                }

                var referenceLocation = await reference.RehydrateAsync(
                    _solution, _cancellationToken).ConfigureAwait(false);

                await _progress.OnReferenceFoundAsync(symbol, referenceLocation).ConfigureAwait(false);
            }
 private ValueTask HandleLocationAsync(ISymbol symbol, ReferenceLocation location)
 => _progress.OnReferenceFoundAsync(symbol, location);
Пример #6
0
 private Task HandleLocationAsync(SymbolAndProjectId symbolAndProjectId, ReferenceLocation location)
 {
     return(_progress.OnReferenceFoundAsync(symbolAndProjectId, location));
 }
 private ValueTask HandleLocationAsync(SymbolGroup group, ISymbol symbol, ReferenceLocation location)
 => _progress.OnReferenceFoundAsync(group, symbol, location);
Пример #8
0
 private Task HandleLocationAsync(SymbolAndProjectId symbolAndProjectId, ReferenceLocation location)
 {
     _foundReferences.GetOrAdd(symbolAndProjectId, s_createSymbolLocations).Add(location);
     return(_progress.OnReferenceFoundAsync(symbolAndProjectId, location));
 }