Skip to content

Commit

Permalink
Merge pull request #64159 from Cosifne/dev/shech/cherrypickPreviewDea…
Browse files Browse the repository at this point in the history
…dlock

Cherrypick for 17.3: Fix potential deadlock if we are previewing a rename change
  • Loading branch information
Cosifne committed Sep 21, 2022
2 parents 7d8de40 + a1db7de commit 80a8ce8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/EditorFeatures/Core/InlineRename/InlineRenameSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,8 @@ private async Task CommitCoreAsync(IUIThreadOperationContext operationContext, b
{
var previewService = _workspace.Services.GetService<IPreviewDialogService>();

// The preview service needs to be called from the UI thread, since it's doing COM calls underneath.
await _threadingContext.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
newSolution = previewService.PreviewChanges(
string.Format(EditorFeaturesResources.Preview_Changes_0, EditorFeaturesResources.Rename),
"vs.csharp.refactoring.rename",
Expand Down

0 comments on commit 80a8ce8

Please sign in to comment.