internal static async Task <CompletionContext> GetCompletionListContextAsync( CompletionService service, CompletionProvider provider, Document document, int position, CompletionTrigger triggerInfo, OptionSet options = null) { options = options ?? document.Project.Solution.Workspace.Options; var text = await document.GetTextAsync(); var span = service.GetDefaultItemSpan(text, position); var context = new CompletionContext(provider, document, position, span, triggerInfo, options, CancellationToken.None); await provider.ProvideCompletionsAsync(context); return(context); }