public async Task <ManagedModuleUpdates> GetManagedModuleUpdatesAsync(CancellationToken cancellationToken)
        {
            try
            {
                var(summary, deltas) = await _encService.EmitSolutionUpdateAsync(cancellationToken).ConfigureAwait(false);

                return(new ManagedModuleUpdates(summary.ToModuleUpdateStatus(), deltas.SelectAsArray(ModuleUtilities.ToModuleUpdate)));
            }
            catch (Exception e) when(FatalError.ReportWithoutCrashUnlessCanceled(e))
            {
                _encService.ReportApplyChangesException(e.Message);
                return(new ManagedModuleUpdates(ManagedModuleUpdateStatus.Blocked, ImmutableArray <ManagedModuleUpdate> .Empty));
            }
        }
        public async Task <ManagedModuleUpdates> GetManagedModuleUpdatesAsync(CancellationToken cancellationToken)
        {
            var solution = _workspace.CurrentSolution;

            try
            {
                var activeStatementSpanProvider = GetActiveStatementSpanProvider(solution);
                var(summary, deltas) = await _encService.EmitSolutionUpdateAsync(solution, activeStatementSpanProvider, cancellationToken).ConfigureAwait(false);

                return(new ManagedModuleUpdates(summary.ToModuleUpdateStatus(), deltas.SelectAsArray(ModuleUtilities.ToModuleUpdate).ToReadOnlyCollection()));
            }
            catch (Exception e) when(FatalError.ReportWithoutCrashUnlessCanceled(e))
            {
                _encService.ReportApplyChangesException(solution, e.Message);
                return(new ManagedModuleUpdates(ManagedModuleUpdateStatus.Blocked, ImmutableArray <DkmManagedModuleUpdate> .Empty.ToReadOnlyCollection()));
            }
        }
        public async ValueTask <ManagedModuleUpdates> GetEditAndContinueUpdatesAsync(Solution solution, CancellationToken cancellationToken)
        {
            var result = await _encService.EmitSolutionUpdateAsync(GetSessionId(), solution, s_noActiveStatementSpanProvider, cancellationToken).ConfigureAwait(false);

            return(result.ModuleUpdates.FromContract());
        }