Beispiel #1
0
        public async Task <IReadOnlyCollection <object> > CreateDescriptionAsync(
            CancellationToken cancellationToken
            )
        {
            var document = _span.Snapshot.GetOpenDocumentInCurrentContextWithChanges();

            if (document != null)
            {
                var taggedText = await _hint
                                 .GetDescriptionAsync(document, cancellationToken)
                                 .ConfigureAwait(false);

                if (!taggedText.IsDefaultOrEmpty)
                {
                    return(Implementation.IntelliSense.Helpers.BuildInteractiveTextElements(
                               taggedText,
                               document,
                               _threadingContext,
                               _streamingPresenter
                               ));
                }
            }

            return(Array.Empty <object>());
        }
Beispiel #2
0
        public async Task <IReadOnlyCollection <object> > CreateDescriptionAsync(CancellationToken cancellationToken)
        {
            var document = _span.Snapshot.GetOpenDocumentInCurrentContextWithChanges();

            if (document != null)
            {
                var taggedText = await _hint.GetDescriptionAsync(document, cancellationToken).ConfigureAwait(false);

                if (!taggedText.IsDefaultOrEmpty)
                {
                    var context = new IntellisenseQuickInfoBuilderContext(
                        document,
                        _taggerProvider.ThreadingContext,
                        _taggerProvider.OperationExecutor,
                        _taggerProvider.AsynchronousOperationListener,
                        _taggerProvider.StreamingFindUsagesPresenter);
                    return(Implementation.IntelliSense.Helpers.BuildInteractiveTextElements(taggedText, context));
                }
            }

            return(Array.Empty <object>());
        }