private async Task ReportSymbolInformationAsync( INavigateToSearchResult result, CancellationToken cancellationToken ) { var location = await ProtocolConversions .TextSpanToLocationAsync( result.NavigableItem.Document, result.NavigableItem.SourceSpan, cancellationToken ) .ConfigureAwait(false); Contract.ThrowIfNull(location); _progress.Report( new VSSymbolInformation { Name = result.Name, ContainerName = result.AdditionalInformation, Kind = ProtocolConversions.NavigateToKindToSymbolKind(result.Kind), Location = location, Icon = new ImageElement(result.NavigableItem.Glyph.GetImageId()) } ); }
public async Task AddItemAsync(Project project, INavigateToSearchResult result, CancellationToken cancellationToken) { var location = await ProtocolConversions.TextSpanToLocationAsync( result.NavigableItem.Document, result.NavigableItem.SourceSpan, result.NavigableItem.IsStale, _context, cancellationToken).ConfigureAwait(false); if (location == null) { return; } _progress.Report(new VSSymbolInformation { Name = result.Name, ContainerName = result.AdditionalInformation, Kind = ProtocolConversions.NavigateToKindToSymbolKind(result.Kind), Location = location, Icon = VSLspExtensionConversions.GetImageIdFromGlyph(result.NavigableItem.Glyph) }); }