Ejemplo n.º 1
0
            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())
                }
                    );
            }
Ejemplo n.º 2
0
            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)
                });
            }