private async Task <SuggestedActionSet> GetPreviewChangesFlavor(CancellationToken cancellationToken)
        {
            // We use ConfigureAwait(true) to stay on the UI thread.
            var previewChangesAction = await PreviewChangesSuggestedAction.CreateAsync(
                this, cancellationToken).ConfigureAwait(true);

            if (previewChangesAction == null)
            {
                return(null);
            }

            return(new SuggestedActionSet(ImmutableArray.Create(previewChangesAction)));
        }
        private SuggestedActionSet GetPreviewChangesSuggestedActionSet()
        {
            var previewResult = GetPreviewResult(CancellationToken.None);
            if (previewResult == null)
            {
                return null;
            }

            var changeSummary = previewResult.ChangeSummary;
            if (changeSummary == null)
            {
                return null;
            }

            var previewAction = new PreviewChangesCodeAction(Workspace, CodeAction, changeSummary);
            var previewSuggestedAction = new PreviewChangesSuggestedAction(Workspace, SubjectBuffer, EditHandler, previewAction, Provider);
            return new SuggestedActionSet(ImmutableArray.Create(previewSuggestedAction));
        }
Exemple #3
0
        private async Task <SuggestedActionSet> GetPreviewChangesSuggestedActionSetAsync(CancellationToken cancellationToken)
        {
            var previewResult = await GetPreviewResultAsync(cancellationToken).ConfigureAwait(true);

            if (previewResult == null)
            {
                return(null);
            }

            var changeSummary = previewResult.ChangeSummary;

            if (changeSummary == null)
            {
                return(null);
            }

            var previewAction          = new PreviewChangesCodeAction(Workspace, CodeAction, changeSummary);
            var previewSuggestedAction = new PreviewChangesSuggestedAction(Workspace, SubjectBuffer, EditHandler, WaitIndicator, previewAction, Provider);

            return(new SuggestedActionSet(ImmutableArray.Create(previewSuggestedAction)));
        }
Exemple #4
0
        private SuggestedActionSet GetPreviewChangesSuggestedActionSet()
        {
            var previewResult = GetPreviewResult(CancellationToken.None);

            if (previewResult == null)
            {
                return(null);
            }

            var changeSummary = previewResult.ChangeSummary;

            if (changeSummary == null)
            {
                return(null);
            }

            var previewAction          = new PreviewChangesCodeAction(Workspace, CodeAction, changeSummary);
            var previewSuggestedAction = new PreviewChangesSuggestedAction(Workspace, SubjectBuffer, EditHandler, previewAction, Provider);

            return(new SuggestedActionSet(ImmutableArray.Create(previewSuggestedAction)));
        }
        private SuggestedActionSet GetPreviewChangesSuggestedActionSet()
        {
            var extensionManager = this.Workspace.Services.GetService <IExtensionManager>();
            var previewResult    = extensionManager.PerformFunction(this.Provider, () => GetPreviewResult(CancellationToken.None));

            if (previewResult == null)
            {
                return(null);
            }

            var changeSummary = previewResult.ChangeSummary;

            if (changeSummary == null)
            {
                return(null);
            }

            var previewAction          = new PreviewChangesCodeAction(Workspace, CodeAction, changeSummary);
            var previewSuggestedAction = new PreviewChangesSuggestedAction(Workspace, SubjectBuffer, EditHandler, previewAction, Provider);

            return(new SuggestedActionSet(ImmutableArray.Create(previewSuggestedAction)));
        }
        private async Task<SuggestedActionSet> GetPreviewChangesSuggestedActionSetAsync(CancellationToken cancellationToken)
        {
            var previewResult = await GetPreviewResultAsync(cancellationToken).ConfigureAwait(true);
            if (previewResult == null)
            {
                return null;
            }

            var changeSummary = previewResult.ChangeSummary;
            if (changeSummary == null)
            {
                return null;
            }

            var previewAction = new PreviewChangesCodeAction(Workspace, CodeAction, changeSummary);
            var previewSuggestedAction = new PreviewChangesSuggestedAction(Workspace, SubjectBuffer, EditHandler, previewAction, Provider);
            return new SuggestedActionSet(ImmutableArray.Create(previewSuggestedAction));
        }