示例#1
0
        internal sealed override Task <Solution> GetChangedSolutionAsync(
            IProgressTracker progressTracker,
            CancellationToken cancellationToken
            )
        {
            cancellationToken.ThrowIfCancellationRequested();
            FixAllLogger.LogState(
                FixAllState,
                IsInternalCodeFixProvider(FixAllState.CodeFixProvider)
                );

            var service =
                FixAllState.Project.Solution.Workspace.Services.GetService <IFixAllGetFixesService>();

            var fixAllContext = new FixAllContext(FixAllState, progressTracker, cancellationToken);

            if (progressTracker != null)
            {
                progressTracker.Description = FixAllContextHelper.GetDefaultFixAllTitle(
                    fixAllContext
                    );
            }

            return(service.GetFixAllChangedSolutionAsync(fixAllContext));
        }
示例#2
0
        internal override Task <ImmutableArray <CodeActionOperation> > ComputeOperationsAsync(
            IProgressTracker progressTracker,
            CancellationToken cancellationToken
            )
        {
            cancellationToken.ThrowIfCancellationRequested();
            FixAllLogger.LogState(
                FixAllState,
                IsInternalCodeFixProvider(FixAllState.CodeFixProvider)
                );

            var service =
                FixAllState.Project.Solution.Workspace.Services.GetService <IFixAllGetFixesService>();

            var fixAllContext = new FixAllContext(FixAllState, progressTracker, cancellationToken);

            if (progressTracker != null)
            {
                progressTracker.Description = FixAllContextHelper.GetDefaultFixAllTitle(
                    fixAllContext
                    );
            }

            return(service.GetFixAllOperationsAsync(fixAllContext, _showPreviewChangesDialog));
        }
示例#3
0
        protected async override Task <Solution> GetChangedSolutionAsync(CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();
            FixAllLogger.LogState(_fixAllState, IsInternalCodeFixProvider(_fixAllState.CodeFixProvider));

            var service = _fixAllState.Project.Solution.Workspace.Services.GetService <IFixAllGetFixesService>();

            // Use the new cancellation token instead of the stale one present inside _fixAllContext.
            return(await service.GetFixAllChangedSolutionAsync(
                       _fixAllState.CreateFixAllContext(cancellationToken)).ConfigureAwait(false));
        }
示例#4
0
        protected override async Task <IEnumerable <CodeActionOperation> > ComputeOperationsAsync(CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();
            FixAllLogger.LogState(_fixAllState, IsInternalCodeFixProvider(_fixAllState.CodeFixProvider));

            var service = _fixAllState.Project.Solution.Workspace.Services.GetService <IFixAllGetFixesService>();

            // Use the new cancellation token instead of the stale one present inside _fixAllContext.
            return(await service.GetFixAllOperationsAsync(
                       _fixAllState.CreateFixAllContext(cancellationToken),
                       _showPreviewChangesDialog).ConfigureAwait(false));
        }
示例#5
0
        internal override Task <ImmutableArray <CodeActionOperation> > ComputeOperationsAsync(
            IProgressTracker progressTracker, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();
            FixAllLogger.LogState(FixAllState, IsInternalCodeFixProvider(FixAllState.CodeFixProvider));

            var service = FixAllState.Project.Solution.Workspace.Services.GetService <IFixAllGetFixesService>();

            // Use the new cancellation token instead of the stale one present inside _fixAllContext.
            return(service.GetFixAllOperationsAsync(
                       new FixAllContext(FixAllState, progressTracker, cancellationToken),
                       _showPreviewChangesDialog));
        }