Exemple #1
0
        public static async Task <CompletionDescription> GetDescriptionAsync(CompletionItem item, ImmutableArray <ISymbol> symbols, Document document, SemanticModel semanticModel, CancellationToken cancellationToken)
        {
            var workspace = document.Project.Solution.Workspace;

            var position           = SymbolCompletionItem.GetDescriptionPosition(item);
            var supportedPlatforms = SymbolCompletionItem.GetSupportedPlatforms(item, workspace);

            var contextDocument = FindAppropriateDocumentForDescriptionContext(document, supportedPlatforms);

            if (symbols.Length != 0)
            {
                return(await CommonCompletionUtilities.CreateDescriptionAsync(workspace, semanticModel, position, symbols, supportedPlatforms, cancellationToken).ConfigureAwait(false));
            }
            else
            {
                return(CompletionDescription.Empty);
            }
        }