private async Task <Solution> PublishLatestSolutionAsync(CancellationToken cancellationToken) { // WORKAROUND: We don't yet have a way to wait for the rename changes to propagate // to Roslyn (tracked by https://github.com/dotnet/project-system/issues/3425), so // instead we wait for the IntelliSense stage to finish for the entire solution IVsOperationProgressStatusService operationProgressStatusService = await _operationProgressService.GetValueAsync(cancellationToken); IVsOperationProgressStageStatus stageStatus = operationProgressStatusService.GetStageStatus(CommonOperationProgressStageIds.Intellisense); await stageStatus.WaitForCompletionAsync().WithCancellation(cancellationToken); // The result of that wait, is basically a "new" published Solution, so grab it return(_workspace.CurrentSolution); }
/// <summary> /// Initializes a new instance of the <see cref="OperationProgressToolWindowControl"/> class. /// </summary> public OperationProgressToolWindowControl() { this.vsOperationProgressService = OperationProgressPackage.Instance.VsOperationProgressService; this.vsOperationProgressStatusService = OperationProgressPackage.Instance.VsOperationProgressStatusService; this.joinableTaskFactory = OperationProgressPackage.Instance.JoinableTaskFactory; this.InitializeComponent(); this.intelliSenseStageStatus = vsOperationProgressStatusService.GetStageStatus(CommonOperationProgressStageIds.Intellisense); this.intelliSenseStageStatus.InProgressChanged += IntelliSenseStatus_InProgressChanged; // Update the status textblock with the current value this.UpdateintelliSenseStatusTextBlock(intelliSenseStageStatus.Status); }