{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/92984881","pull_request_review_id":13505216,"id":92984881,"diff_hunk":"@@ -149,30 +150,28 @@ public void Invoke(CancellationToken cancellationToken)\n         private async Task InvokeWorkerAsync(\n             Func<Document> getFromDocument, IProgressTracker progressTracker, CancellationToken cancellationToken)\n         {\n-            this.AssertIsForeground();\n+            AssertIsForeground();\n             IEnumerable<CodeActionOperation> operations = null;\n-\n             // NOTE: As mentioned above, we want to avoid computing the operations on the UI thread.\n             // However, for CodeActionWithOptions, GetOptions() might involve spinning up a dialog\n             // to compute the options and must be done on the UI thread.\n-            var actionWithOptions = this.CodeAction as CodeActionWithOptions;\n-            if (actionWithOptions != null)\n+            if (CodeAction is CodeActionWithOptions actionWithOptions)\n             {\n                 var options = actionWithOptions.GetOptions(cancellationToken);\n                 if (options != null)\n                 {\n                     // ConfigureAwait(true) so we come back to the same thread as \n                     // we do all application on the UI thread.\n                     operations = await GetOperationsAsync(actionWithOptions, options, cancellationToken).ConfigureAwait(true);\n-                    this.AssertIsForeground();","path":"src/EditorFeatures/Core/Implementation/Suggestions/SuggestedAction.cs","position":127,"original_position":127,"commit_id":"344ef7357b4c4d19ab82cdfbca8b55c2cdf7574d","original_commit_id":"344ef7357b4c4d19ab82cdfbca8b55c2cdf7574d","user":{"login":"CyrusNajmabadi","id":4564579,"avatar_url":"https://avatars.githubusercontent.com/u/4564579?v=3","gravatar_id":"","url":"https://api.github.com/users/CyrusNajmabadi","html_url":"https://github.com/CyrusNajmabadi","followers_url":"https://api.github.com/users/CyrusNajmabadi/followers","following_url":"https://api.github.com/users/CyrusNajmabadi/following{/other_user}","gists_url":"https://api.github.com/users/CyrusNajmabadi/gists{/gist_id}","starred_url":"https://api.github.com/users/CyrusNajmabadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CyrusNajmabadi/subscriptions","organizations_url":"https://api.github.com/users/CyrusNajmabadi/orgs","repos_url":"https://api.github.com/users/CyrusNajmabadi/repos","events_url":"https://api.github.com/users/CyrusNajmabadi/events{/privacy}","received_events_url":"https://api.github.com/users/CyrusNajmabadi/received_events","type":"User","site_admin":false},"body":"since we ConfigureAwait(true) here, how do we avoid deadlocking since you called 'Wait' above?","created_at":"2016-12-19T08:20:30Z","updated_at":"2016-12-19T08:20:30Z","html_url":"https://github.com/dotnet/roslyn/pull/15767#discussion_r92984881","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/15767","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/92984881"},"html":{"href":"https://github.com/dotnet/roslyn/pull/15767#discussion_r92984881"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/15767"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/15767","id":97100013,"html_url":"https://github.com/dotnet/roslyn/pull/15767","diff_url":"https://github.com/dotnet/roslyn/pull/15767.diff","patch_url":"https://github.com/dotnet/roslyn/pull/15767.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/15767","number":15767,"state":"open","locked":false,"title":"Ensure that the wait context is created on a background thread","user":{"login":"jmarolf","id":9797472,"avatar_url":"https://avatars.githubusercontent.com/u/9797472?v=3","gravatar_id":"","url":"https://api.github.com/users/jmarolf","html_url":"https://github.com/jmarolf","followers_url":"https://api.github.com/users/jmarolf/followers","following_url":"https://api.github.com/users/jmarolf/following{/other_user}","gists_url":"https://api.github.com/users/jmarolf/gists{/gist_id}","starred_url":"https://api.github.com/users/jmarolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmarolf/subscriptions","organizations_url":"https://api.github.com/users/jmarolf/orgs","repos_url":"https://api.github.com/users/jmarolf/repos","events_url":"https://api.github.com/users/jmarolf/events{/privacy}","received_events_url":"https://api.github.com/users/jmarolf/received_events","type":"User","site_admin":false},"body":"**Customer scenario**\r\n\r\nApplying any codefix will never show a wait dialog, no matter how long the operation takes.  This includes fixes in a single application of a fix, or fixall in Document, Project, or Solution.\r\n\r\n**Bugs this fixes:** \r\n\r\nhttps://github.com/dotnet/roslyn/issues/15411\r\nhttps://github.com/dotnet/roslyn/issues/15761\r\nhttps://github.com/dotnet/roslyn/issues/15775\r\n\r\n**Workarounds, if any**\r\n\r\nNone\r\n\r\n**Risk**\r\n\r\nLow, the only semantic change is moving wait context creation to a background thread, and blocking on codefix computation.\r\n\r\n**Performance impact**\r\n\r\nLow, the only semantic change is moving wait context creation to a background thread, and blocking on codefix computation.\r\n\r\n**Is this a regression from a previous update?**\r\n\r\nYes, this was introduced in RC.2\r\n\r\n**Root cause analysis:**\r\n\r\nCyrus made a large refactoring to Fixall in RC.2.  All of our internal understanding of how the threaded wait dialog works led us to believe that creation on a forground thread and then awaiting a background thread was a legal thing to do.  Turns out creation on a forground thread then yielding to a background thread causes the threaded wait dialog to never pop up.  The fix is to queue the dialog's creation on a background thread.\r\n\r\n**How was the bug found?**\r\n\r\ndogfooding","created_at":"2016-12-08T10:56:15Z","updated_at":"2016-12-19T08:20:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d5956b28755df0d757dab5f2ef25a392333c991e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/15767/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/15767/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/15767/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/344ef7357b4c4d19ab82cdfbca8b55c2cdf7574d","head":{"label":"jmarolf:bugfix/refactor-wait-dialog-for-codefixes","ref":"bugfix/refactor-wait-dialog-for-codefixes","sha":"344ef7357b4c4d19ab82cdfbca8b55c2cdf7574d","user":{"login":"jmarolf","id":9797472,"avatar_url":"https://avatars.githubusercontent.com/u/9797472?v=3","gravatar_id":"","url":"https://api.github.com/users/jmarolf","html_url":"https://github.com/jmarolf","followers_url":"https://api.github.com/users/jmarolf/followers","following_url":"https://api.github.com/users/jmarolf/following{/other_user}","gists_url":"https://api.github.com/users/jmarolf/gists{/gist_id}","starred_url":"https://api.github.com/users/jmarolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmarolf/subscriptions","organizations_url":"https://api.github.com/users/jmarolf/orgs","repos_url":"https://api.github.com/users/jmarolf/repos","events_url":"https://api.github.com/users/jmarolf/events{/privacy}","received_events_url":"https://api.github.com/users/jmarolf/received_events","type":"User","site_admin":false},"repo":{"id":29874637,"name":"roslyn","full_name":"jmarolf/roslyn","owner":{"login":"jmarolf","id":9797472,"avatar_url":"https://avatars.githubusercontent.com/u/9797472?v=3","gravatar_id":"","url":"https://api.github.com/users/jmarolf","html_url":"https://github.com/jmarolf","followers_url":"https://api.github.com/users/jmarolf/followers","following_url":"https://api.github.com/users/jmarolf/following{/other_user}","gists_url":"https://api.github.com/users/jmarolf/gists{/gist_id}","starred_url":"https://api.github.com/users/jmarolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmarolf/subscriptions","organizations_url":"https://api.github.com/users/jmarolf/orgs","repos_url":"https://api.github.com/users/jmarolf/repos","events_url":"https://api.github.com/users/jmarolf/events{/privacy}","received_events_url":"https://api.github.com/users/jmarolf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmarolf/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":true,"url":"https://api.github.com/repos/jmarolf/roslyn","forks_url":"https://api.github.com/repos/jmarolf/roslyn/forks","keys_url":"https://api.github.com/repos/jmarolf/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmarolf/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmarolf/roslyn/teams","hooks_url":"https://api.github.com/repos/jmarolf/roslyn/hooks","issue_events_url":"https://api.github.com/repos/jmarolf/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/jmarolf/roslyn/events","assignees_url":"https://api.github.com/repos/jmarolf/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/jmarolf/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/jmarolf/roslyn/tags","blobs_url":"https://api.github.com/repos/jmarolf/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmarolf/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmarolf/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmarolf/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmarolf/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/jmarolf/roslyn/languages","stargazers_url":"https://api.github.com/repos/jmarolf/roslyn/stargazers","contributors_url":"https://api.github.com/repos/jmarolf/roslyn/contributors","subscribers_url":"https://api.github.com/repos/jmarolf/roslyn/subscribers","subscription_url":"https://api.github.com/repos/jmarolf/roslyn/subscription","commits_url":"https://api.github.com/repos/jmarolf/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmarolf/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmarolf/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmarolf/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmarolf/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/jmarolf/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmarolf/roslyn/merges","archive_url":"https://api.github.com/repos/jmarolf/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmarolf/roslyn/downloads","issues_url":"https://api.github.com/repos/jmarolf/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/jmarolf/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/jmarolf/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/jmarolf/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmarolf/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/jmarolf/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/jmarolf/roslyn/deployments","created_at":"2015-01-26T18:16:39Z","updated_at":"2015-09-24T00:09:04Z","pushed_at":"2016-12-19T07:20:48Z","git_url":"git://github.com/jmarolf/roslyn.git","ssh_url":"git@github.com:jmarolf/roslyn.git","clone_url":"https://github.com/jmarolf/roslyn.git","svn_url":"https://github.com/jmarolf/roslyn","homepage":"","size":194269,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"e59176f7c7e6df8f9e0d3b91b87f8dee98692399","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":29078997,"name":"roslyn","full_name":"dotnet/roslyn","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":false,"url":"https://api.github.com/repos/dotnet/roslyn","forks_url":"https://api.github.com/repos/dotnet/roslyn/forks","keys_url":"https://api.github.com/repos/dotnet/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/roslyn/teams","hooks_url":"https://api.github.com/repos/dotnet/roslyn/hooks","issue_events_url":"https://api.github.com/repos/dotnet/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/roslyn/events","assignees_url":"https://api.github.com/repos/dotnet/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/roslyn/tags","blobs_url":"https://api.github.com/repos/dotnet/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/roslyn/languages","stargazers_url":"https://api.github.com/repos/dotnet/roslyn/stargazers","contributors_url":"https://api.github.com/repos/dotnet/roslyn/contributors","subscribers_url":"https://api.github.com/repos/dotnet/roslyn/subscribers","subscription_url":"https://api.github.com/repos/dotnet/roslyn/subscription","commits_url":"https://api.github.com/repos/dotnet/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/roslyn/merges","archive_url":"https://api.github.com/repos/dotnet/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/roslyn/downloads","issues_url":"https://api.github.com/repos/dotnet/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/roslyn/deployments","created_at":"2015-01-11T02:39:03Z","updated_at":"2016-12-19T08:12:38Z","pushed_at":"2016-12-19T07:20:49Z","git_url":"git://github.com/dotnet/roslyn.git","ssh_url":"git@github.com:dotnet/roslyn.git","clone_url":"https://github.com/dotnet/roslyn.git","svn_url":"https://github.com/dotnet/roslyn","homepage":"","size":196313,"stargazers_count":6709,"watchers_count":6709,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1616,"mirror_url":null,"open_issues_count":3532,"forks":1616,"open_issues":3532,"watchers":6709,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/15767"},"html":{"href":"https://github.com/dotnet/roslyn/pull/15767"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/15767"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/15767/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/15767/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/15767/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/344ef7357b4c4d19ab82cdfbca8b55c2cdf7574d"}}}}
{"actor":{"display_login":"CyrusNajmabadi"}}