{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/208443631","pull_request_review_id":144253440,"id":208443631,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwODQ0MzYzMQ==","diff_hunk":"@@ -29,12 +35,12 @@ public async Task GetSymbolsAsync(GoToSymbolContext context)\n             // We want ctrl-click GTD to be as close to regular GTD as possible.\n             // This means we have to query for \"third party navigation\", from\n             // XAML, etc. That call has to be done on the UI thread.\n-            var definitions = await Task.Factory.StartNew(() =>\n-                GoToDefinitionHelpers.GetDefinitions(symbol, document.Project, thirdPartyNavigationAllowed: true, cancellationToken: cancellationToken)\n-                    .WhereAsArray(d => d.CanNavigateTo(document.Project.Solution.Workspace)),\n-                        cancellationToken,\n-                        TaskCreationOptions.None,\n-                        ForegroundTaskScheduler).ConfigureAwait(false);\n+            await ThreadingContext.JoinableTaskFactory.SwitchToMainThreadAsync(alwaysYield: true, cancellationToken);\n+\n+            var definitions = GoToDefinitionHelpers.GetDefinitions(symbol, document.Project, thirdPartyNavigationAllowed: true, cancellationToken)\n+                .WhereAsArray(d => d.CanNavigateTo(document.Project.Solution.Workspace));\n+\n+            await TaskScheduler.Default;","path":"src/EditorFeatures/Core/GoToDefinition/AbstractGoToSymbolService.cs","position":34,"original_position":34,"commit_id":"89a99920da7920540b9d88e61972c1b30690f5b4","original_commit_id":"89a99920da7920540b9d88e61972c1b30690f5b4","user":{"login":"sharwell","id":1408396,"node_id":"MDQ6VXNlcjE0MDgzOTY=","avatar_url":"https://avatars1.githubusercontent.com/u/1408396?v=4","gravatar_id":"","url":"https://api.github.com/users/sharwell","html_url":"https://github.com/sharwell","followers_url":"https://api.github.com/users/sharwell/followers","following_url":"https://api.github.com/users/sharwell/following{/other_user}","gists_url":"https://api.github.com/users/sharwell/gists{/gist_id}","starred_url":"https://api.github.com/users/sharwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharwell/subscriptions","organizations_url":"https://api.github.com/users/sharwell/orgs","repos_url":"https://api.github.com/users/sharwell/repos","events_url":"https://api.github.com/users/sharwell/events{/privacy}","received_events_url":"https://api.github.com/users/sharwell/received_events","type":"User","site_admin":false},"body":"➡️ Custom struct awaiter","created_at":"2018-08-08T03:02:39Z","updated_at":"2018-08-08T03:02:40Z","html_url":"https://github.com/dotnet/roslyn/pull/28781#discussion_r208443631","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/28781","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/208443631"},"html":{"href":"https://github.com/dotnet/roslyn/pull/28781#discussion_r208443631"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/28781"}},"in_reply_to_id":208402494},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/28781","id":203282139,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzMjgyMTM5","html_url":"https://github.com/dotnet/roslyn/pull/28781","diff_url":"https://github.com/dotnet/roslyn/pull/28781.diff","patch_url":"https://github.com/dotnet/roslyn/pull/28781.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/28781","number":28781,"state":"open","locked":false,"title":"Migrate to Microsoft.VisualStudio.Threading","user":{"login":"sharwell","id":1408396,"node_id":"MDQ6VXNlcjE0MDgzOTY=","avatar_url":"https://avatars1.githubusercontent.com/u/1408396?v=4","gravatar_id":"","url":"https://api.github.com/users/sharwell","html_url":"https://github.com/sharwell","followers_url":"https://api.github.com/users/sharwell/followers","following_url":"https://api.github.com/users/sharwell/following{/other_user}","gists_url":"https://api.github.com/users/sharwell/gists{/gist_id}","starred_url":"https://api.github.com/users/sharwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharwell/subscriptions","organizations_url":"https://api.github.com/users/sharwell/orgs","repos_url":"https://api.github.com/users/sharwell/repos","events_url":"https://api.github.com/users/sharwell/events{/privacy}","received_events_url":"https://api.github.com/users/sharwell/received_events","type":"User","site_admin":false},"body":"This change implements the first step towards Roslyn working in applications using vs-threading with reduced risk of concurrency bugs. Recommend reviewing by commit after looking at the full list to get an idea for the overall direction.\r\n\r\nMost of the work in this change involves internal propagation of the `IThreadingContext` instance, which provides access to the `JoinableTaskFactory` used in Roslyn code.\r\n\r\nFollowing this pull request, several diagnostics remain disabled.\r\n\r\n* VSTHRD002 (Avoid problematic synchronous waits): Many of the violations reported by this can be fixed by a code fix, but the code fix is a bit buggy and I'm waiting for Microsoft/vs-threading#338 so it's easier to prepare the fixes.\r\n* VSTHRD103 (Call async methods when in an async method): This will be sent as a follow-up pull request. The analysis will be improved by Microsoft/vs-threading#331, but I didn't see any reason why it would block our use of the analyzer.\r\n* VSTHRD110 (Observe result of async calls): We need to establish the \"Roslyn desired practice for `FileAndForget`\" before enabling this diagnostic.\r\n* VSTHRD200 (Use \"Async\" suffix for async methods): Will send a follow-up PR to enable this and fix all cases that aren't exposed (public API and/or IVT). It affected too many files to include here.\r\n* VSTHRD010 (Invoke single-threaded types on Main thread): This diagnostic is enabled, but its accuracy relies heavily on configuration files provided separately. The configuration for VSSDK types ships with the VSSDK analyzers, which are not yet enabled for the full Roslyn build.\r\n\r\nKnown follow-up issues (GitHub issues will be linked here once they are available):\r\n\r\n* Enable VSTHRD002 (see above)\r\n* Enable VSTHRD103 (see above)\r\n* Enable VSTHRD110 (see above)\r\n* Enable VSTHRD200 (see above)\r\n* Configure `WaitAndGetResult` and `WaitAndGetResult_CanCallOnBackground` as problematic synchronous waits (blocked on Microsoft/vs-threading#344)\r\n* Review code for additional methods to consider legacy thread switching APIs (blocked on Microsoft/vs-threading#332)\r\n* Update VSSDK analyzers to enable VSTHRD010 (see above)\r\n* Eliminate `ForegroundThreadDataKind`, and gut or eliminate `ForegroundThreadAffinitizedObject` https://github.com/dotnet/roslyn/pull/28781#discussion_r208386101\r\n* Consider making `JoinableTaskContext` a required import for `ThreadingContext` https://github.com/dotnet/roslyn/pull/28781#discussion_r208386283\r\n* Eliminate `JoinableTaskFactoryTaskScheduler`, or at least add it to the set of legacy thread switching types https://github.com/dotnet/roslyn/pull/28781#discussion_r208393493\r\n* **PERF:** Improve **CPSProject_IWorkspaceProjectContext.cs** https://github.com/dotnet/roslyn/pull/28781#discussion_r208393997\r\n\r\n### Customer scenario\r\n\r\nThis is an internal code change that allows dotnet/roslyn to be more easily incorporated into applications that involve user interfaces and leverage the Microsoft.VisualStudio.Threading library for deadlock and reentrancy mitigation and overall best practices.\r\n\r\n### Bugs this fixes\r\n\r\nN/A\r\n\r\n### Workarounds, if any\r\n\r\nFixing bugs as they occur.\r\n\r\n### Risk\r\n\r\nThis change has moderate risk, but I believe it's *relatively* low risk considering its scope since existing behaviors were preserved where possible. The primary points where I see risk are the following:\r\n\r\n* Not all portions of code were updated to follow the [Three threading rules](https://github.com/Microsoft/vs-threading/blob/master/doc/threading_rules.md), and incremental adoption of vs-threading runs a risk of deadlocks when code does not follow these rules.\r\n* While the documented precondition of `WaitAndGetResult` was weakened, the debug assertion it contained was strengthened substantially. This code does not affect release builds, but despite the work in this pull request it may continue to affect debug pull request builds.\r\n\r\n### Performance impact\r\n\r\nPerformance should not change substantially as a direct result of this pull request. Over time, performance should improve by allowing more code to use asynchronous operations and more efficient task continuations.\r\n\r\n### Is this a regression from a previous update?\r\n\r\nN/A\r\n\r\n### Root cause analysis\r\n\r\nN/A\r\n\r\n### How was the bug found?\r\n\r\nN/A\r\n\r\n### Test documentation updated?\r\n\r\nN/A\r\n","created_at":"2018-07-23T16:57:40Z","updated_at":"2018-08-08T03:02:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da48548db802d238209eb2e40c3927c5305a66fd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[{"name":"roslyn-interactive","id":1803183,"node_id":"MDQ6VGVhbTE4MDMxODM=","slug":"roslyn-interactive","description":"C# & VB Interactive (scripting, debugging, etc)","privacy":"closed","url":"https://api.github.com/teams/1803183","members_url":"https://api.github.com/teams/1803183/members{/member}","repositories_url":"https://api.github.com/teams/1803183/repos","permission":"pull"}],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/28781/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/28781/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/28781/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/89a99920da7920540b9d88e61972c1b30690f5b4","head":{"label":"sharwell:vs-threading-analyzers","ref":"vs-threading-analyzers","sha":"89a99920da7920540b9d88e61972c1b30690f5b4","user":{"login":"sharwell","id":1408396,"node_id":"MDQ6VXNlcjE0MDgzOTY=","avatar_url":"https://avatars1.githubusercontent.com/u/1408396?v=4","gravatar_id":"","url":"https://api.github.com/users/sharwell","html_url":"https://github.com/sharwell","followers_url":"https://api.github.com/users/sharwell/followers","following_url":"https://api.github.com/users/sharwell/following{/other_user}","gists_url":"https://api.github.com/users/sharwell/gists{/gist_id}","starred_url":"https://api.github.com/users/sharwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharwell/subscriptions","organizations_url":"https://api.github.com/users/sharwell/orgs","repos_url":"https://api.github.com/users/sharwell/repos","events_url":"https://api.github.com/users/sharwell/events{/privacy}","received_events_url":"https://api.github.com/users/sharwell/received_events","type":"User","site_admin":false},"repo":{"id":29280707,"node_id":"MDEwOlJlcG9zaXRvcnkyOTI4MDcwNw==","name":"roslyn","full_name":"sharwell/roslyn","owner":{"login":"sharwell","id":1408396,"node_id":"MDQ6VXNlcjE0MDgzOTY=","avatar_url":"https://avatars1.githubusercontent.com/u/1408396?v=4","gravatar_id":"","url":"https://api.github.com/users/sharwell","html_url":"https://github.com/sharwell","followers_url":"https://api.github.com/users/sharwell/followers","following_url":"https://api.github.com/users/sharwell/following{/other_user}","gists_url":"https://api.github.com/users/sharwell/gists{/gist_id}","starred_url":"https://api.github.com/users/sharwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharwell/subscriptions","organizations_url":"https://api.github.com/users/sharwell/orgs","repos_url":"https://api.github.com/users/sharwell/repos","events_url":"https://api.github.com/users/sharwell/events{/privacy}","received_events_url":"https://api.github.com/users/sharwell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sharwell/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/sharwell/roslyn","forks_url":"https://api.github.com/repos/sharwell/roslyn/forks","keys_url":"https://api.github.com/repos/sharwell/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sharwell/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sharwell/roslyn/teams","hooks_url":"https://api.github.com/repos/sharwell/roslyn/hooks","issue_events_url":"https://api.github.com/repos/sharwell/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/sharwell/roslyn/events","assignees_url":"https://api.github.com/repos/sharwell/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/sharwell/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/sharwell/roslyn/tags","blobs_url":"https://api.github.com/repos/sharwell/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sharwell/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sharwell/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/sharwell/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sharwell/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/sharwell/roslyn/languages","stargazers_url":"https://api.github.com/repos/sharwell/roslyn/stargazers","contributors_url":"https://api.github.com/repos/sharwell/roslyn/contributors","subscribers_url":"https://api.github.com/repos/sharwell/roslyn/subscribers","subscription_url":"https://api.github.com/repos/sharwell/roslyn/subscription","commits_url":"https://api.github.com/repos/sharwell/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/sharwell/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/sharwell/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/sharwell/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/sharwell/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/sharwell/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sharwell/roslyn/merges","archive_url":"https://api.github.com/repos/sharwell/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sharwell/roslyn/downloads","issues_url":"https://api.github.com/repos/sharwell/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/sharwell/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/sharwell/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/sharwell/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sharwell/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/sharwell/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/sharwell/roslyn/deployments","created_at":"2015-01-15T04:27:54Z","updated_at":"2018-05-22T18:34:53Z","pushed_at":"2018-08-07T14:53:58Z","git_url":"git://github.com/sharwell/roslyn.git","ssh_url":"git@github.com:sharwell/roslyn.git","clone_url":"https://github.com/sharwell/roslyn.git","svn_url":"https://github.com/sharwell/roslyn","homepage":"","size":370547,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"f2c441274de1620496975ee223ec255c13bcafaa","user":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnkyOTA3ODk5Nw==","name":"roslyn","full_name":"dotnet/roslyn","owner":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","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":"2018-08-07T23:17:36Z","pushed_at":"2018-08-08T02:56:15Z","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":423902,"stargazers_count":9678,"watchers_count":9678,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2299,"mirror_url":null,"archived":false,"open_issues_count":5006,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2299,"open_issues":5006,"watchers":9678,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/28781"},"html":{"href":"https://github.com/dotnet/roslyn/pull/28781"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/28781"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/28781/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/28781/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/28781/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/89a99920da7920540b9d88e61972c1b30690f5b4"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"sharwell"}}