private async IAsyncEnumerable <SuggestedActionSet> GetCodeFixesAndRefactoringsAsync( ReferenceCountedDisposable <State> state, ISuggestedActionCategorySet requestedActionCategories, Document document, SnapshotSpan range, TextSpan?selection, Func <string, IDisposable?> addOperationScope, CodeActionRequestPriority priority, int currentActionCount, [EnumeratorCancellation] CancellationToken cancellationToken) { var workspace = document.Project.Solution.Workspace; var supportsFeatureService = workspace.Services.GetRequiredService <ITextBufferSupportsFeatureService>(); var options = GlobalOptions.GetCodeActionOptions(document.Project.Language); var fixesTask = GetCodeFixesAsync( state, supportsFeatureService, requestedActionCategories, workspace, document, range, addOperationScope, priority, options, cancellationToken); var refactoringsTask = GetRefactoringsAsync( state, supportsFeatureService, requestedActionCategories, GlobalOptions, workspace, document, selection, addOperationScope, priority, options, cancellationToken); await Task.WhenAll(fixesTask, refactoringsTask).ConfigureAwait(false); var fixes = await fixesTask.ConfigureAwait(false); var refactorings = await refactoringsTask.ConfigureAwait(false); foreach (var set in ConvertToSuggestedActionSets(state, selection, fixes, refactorings, currentActionCount)) { yield return(set); } }