{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/202457881","pull_request_review_id":137171194,"id":202457881,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjQ1Nzg4MQ==","diff_hunk":"@@ -40,24 +39,37 @@ internal sealed class LanguageSettingsPersister : ForegroundThreadAffinitizedObj\n         /// but the ngen image will exist for the basic map between two reference types, since those are reused.</remarks>\n         private readonly IBidirectionalMap<string, Tuple<Guid>> _languageMap;\n \n+        private IVsTextManager4 _textManager;\n+        private ComEventSink _textManagerEvents2Sink;\n+\n         /// <remarks>\n         /// We make sure this code is from the UI by asking for all serializers on the UI thread in <see cref=\"HACK_AbstractCreateServicesOnUiThread\"/>.\n         /// </remarks>\n         [ImportingConstructor]\n+        [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]\n         public LanguageSettingsPersister(\n-            [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,\n-            IGlobalOptionService optionService)\n+            IGlobalOptionService optionService, [Import(typeof(SAsyncServiceProvider))] Shell.IAsyncServiceProvider serviceProvider)\n             : base(assertIsForeground: true)\n         {\n-            _textManager = (IVsTextManager4)serviceProvider.GetService(typeof(SVsTextManager));\n             _optionService = optionService;\n+            _serviceProvider = serviceProvider;\n \n             // TODO: make this configurable\n             _languageMap = BidirectionalMap<string, Tuple<Guid>>.Empty.Add(LanguageNames.CSharp, Tuple.Create(Guids.CSharpLanguageServiceId))\n                                                                .Add(LanguageNames.VisualBasic, Tuple.Create(Guids.VisualBasicLanguageServiceId))\n                                                                .Add(\"TypeScript\", Tuple.Create(new Guid(\"4a0dddb5-7a95-4fbf-97cc-616d07737a77\")))\n                                                                .Add(\"F#\", Tuple.Create(new Guid(\"BC6DD5A5-D4D6-4dab-A00D-A51242DBAF1B\")))\n                                                                .Add(\"Xaml\", Tuple.Create(new Guid(\"CD53C9A1-6BC2-412B-BE36-CC715ED8DD41\")));\n+        }\n+\n+        public async Task InitializeAsync(CancellationToken cancellationToken)\n+        {\n+            AssertIsForeground();\n+\n+            cancellationToken.ThrowIfCancellationRequested();\n+\n+            _textManager = (IVsTextManager4)await _serviceProvider.GetServiceAsync(typeof(SVsTextManager)).ConfigureAwait(true);\n+            Assumes.Present(_textManager);\n \n             foreach (var languageGuid in _languageMap.Values)","path":"src/VisualStudio/Core/Def/Implementation/Options/LanguageSettingsPersister.cs","position":66,"original_position":66,"commit_id":"93b6402d1b5862f0d7b2dbb5cbb04526bbe91fad","original_commit_id":"93b6402d1b5862f0d7b2dbb5cbb04526bbe91fad","user":{"login":"heejaechang","id":1333179,"node_id":"MDQ6VXNlcjEzMzMxNzk=","avatar_url":"https://avatars3.githubusercontent.com/u/1333179?v=4","gravatar_id":"","url":"https://api.github.com/users/heejaechang","html_url":"https://github.com/heejaechang","followers_url":"https://api.github.com/users/heejaechang/followers","following_url":"https://api.github.com/users/heejaechang/following{/other_user}","gists_url":"https://api.github.com/users/heejaechang/gists{/gist_id}","starred_url":"https://api.github.com/users/heejaechang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heejaechang/subscriptions","organizations_url":"https://api.github.com/users/heejaechang/orgs","repos_url":"https://api.github.com/users/heejaechang/repos","events_url":"https://api.github.com/users/heejaechang/events{/privacy}","received_events_url":"https://api.github.com/users/heejaechang/received_events","type":"User","site_admin":false},"body":"this is more of to see whether we want this approach. so, for ones, that can't be moved to BG, we will leave things as it is?\r\n\r\n...\r\n\r\nthis particular one I didn't get response, but other native IVs Services, it looks like it will take sometime for all those to be free-threaded.\r\n\r\nfor those, current benefit we can expect is moving it to Async but keep it on UI thread. but ones call GetService from ctor on UI thread, that won't be possible.","created_at":"2018-07-13T20:00:26Z","updated_at":"2018-07-13T20:00:26Z","html_url":"https://github.com/dotnet/roslyn/pull/28488#discussion_r202457881","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/28488","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/202457881"},"html":{"href":"https://github.com/dotnet/roslyn/pull/28488#discussion_r202457881"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/28488"}},"in_reply_to_id":202457072},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/28488","id":201135005,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxMTM1MDA1","html_url":"https://github.com/dotnet/roslyn/pull/28488","diff_url":"https://github.com/dotnet/roslyn/pull/28488.diff","patch_url":"https://github.com/dotnet/roslyn/pull/28488.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/28488","number":28488,"state":"open","locked":false,"title":"make IOptionService to use AsyncServiceProvider","user":{"login":"heejaechang","id":1333179,"node_id":"MDQ6VXNlcjEzMzMxNzk=","avatar_url":"https://avatars3.githubusercontent.com/u/1333179?v=4","gravatar_id":"","url":"https://api.github.com/users/heejaechang","html_url":"https://github.com/heejaechang","followers_url":"https://api.github.com/users/heejaechang/followers","following_url":"https://api.github.com/users/heejaechang/following{/other_user}","gists_url":"https://api.github.com/users/heejaechang/gists{/gist_id}","starred_url":"https://api.github.com/users/heejaechang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heejaechang/subscriptions","organizations_url":"https://api.github.com/users/heejaechang/orgs","repos_url":"https://api.github.com/users/heejaechang/repos","events_url":"https://api.github.com/users/heejaechang/events{/privacy}","received_events_url":"https://api.github.com/users/heejaechang/received_events","type":"User","site_admin":false},"body":"for now, they still run on UI thread. but uses GetServiceAsync.\r\n\r\nnative service will take some time to be free-thread service\r\n","created_at":"2018-07-12T21:47:13Z","updated_at":"2018-07-13T20:00:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"770468edee7b161dcfb70a80ae125eed3017ee17","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/28488/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/28488/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/28488/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/93b6402d1b5862f0d7b2dbb5cbb04526bbe91fad","head":{"label":"heejaechang:asyncservice","ref":"asyncservice","sha":"93b6402d1b5862f0d7b2dbb5cbb04526bbe91fad","user":{"login":"heejaechang","id":1333179,"node_id":"MDQ6VXNlcjEzMzMxNzk=","avatar_url":"https://avatars3.githubusercontent.com/u/1333179?v=4","gravatar_id":"","url":"https://api.github.com/users/heejaechang","html_url":"https://github.com/heejaechang","followers_url":"https://api.github.com/users/heejaechang/followers","following_url":"https://api.github.com/users/heejaechang/following{/other_user}","gists_url":"https://api.github.com/users/heejaechang/gists{/gist_id}","starred_url":"https://api.github.com/users/heejaechang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heejaechang/subscriptions","organizations_url":"https://api.github.com/users/heejaechang/orgs","repos_url":"https://api.github.com/users/heejaechang/repos","events_url":"https://api.github.com/users/heejaechang/events{/privacy}","received_events_url":"https://api.github.com/users/heejaechang/received_events","type":"User","site_admin":false},"repo":{"id":30170221,"node_id":"MDEwOlJlcG9zaXRvcnkzMDE3MDIyMQ==","name":"roslyn","full_name":"heejaechang/roslyn","owner":{"login":"heejaechang","id":1333179,"node_id":"MDQ6VXNlcjEzMzMxNzk=","avatar_url":"https://avatars3.githubusercontent.com/u/1333179?v=4","gravatar_id":"","url":"https://api.github.com/users/heejaechang","html_url":"https://github.com/heejaechang","followers_url":"https://api.github.com/users/heejaechang/followers","following_url":"https://api.github.com/users/heejaechang/following{/other_user}","gists_url":"https://api.github.com/users/heejaechang/gists{/gist_id}","starred_url":"https://api.github.com/users/heejaechang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heejaechang/subscriptions","organizations_url":"https://api.github.com/users/heejaechang/orgs","repos_url":"https://api.github.com/users/heejaechang/repos","events_url":"https://api.github.com/users/heejaechang/events{/privacy}","received_events_url":"https://api.github.com/users/heejaechang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/heejaechang/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/heejaechang/roslyn","forks_url":"https://api.github.com/repos/heejaechang/roslyn/forks","keys_url":"https://api.github.com/repos/heejaechang/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heejaechang/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heejaechang/roslyn/teams","hooks_url":"https://api.github.com/repos/heejaechang/roslyn/hooks","issue_events_url":"https://api.github.com/repos/heejaechang/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/heejaechang/roslyn/events","assignees_url":"https://api.github.com/repos/heejaechang/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/heejaechang/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/heejaechang/roslyn/tags","blobs_url":"https://api.github.com/repos/heejaechang/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heejaechang/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heejaechang/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/heejaechang/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heejaechang/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/heejaechang/roslyn/languages","stargazers_url":"https://api.github.com/repos/heejaechang/roslyn/stargazers","contributors_url":"https://api.github.com/repos/heejaechang/roslyn/contributors","subscribers_url":"https://api.github.com/repos/heejaechang/roslyn/subscribers","subscription_url":"https://api.github.com/repos/heejaechang/roslyn/subscription","commits_url":"https://api.github.com/repos/heejaechang/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/heejaechang/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/heejaechang/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/heejaechang/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/heejaechang/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/heejaechang/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heejaechang/roslyn/merges","archive_url":"https://api.github.com/repos/heejaechang/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heejaechang/roslyn/downloads","issues_url":"https://api.github.com/repos/heejaechang/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/heejaechang/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/heejaechang/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/heejaechang/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heejaechang/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/heejaechang/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/heejaechang/roslyn/deployments","created_at":"2015-02-02T03:54:43Z","updated_at":"2018-06-28T23:31:14Z","pushed_at":"2018-07-13T19:14:21Z","git_url":"git://github.com/heejaechang/roslyn.git","ssh_url":"git@github.com:heejaechang/roslyn.git","clone_url":"https://github.com/heejaechang/roslyn.git","svn_url":"https://github.com/heejaechang/roslyn","homepage":"","size":347758,"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":0,"mirror_url":null,"archived":false,"open_issues_count":1,"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":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"c50e7c8a3b9345d98996d5117c70520ad15aa69d","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-07-13T16:15:06Z","pushed_at":"2018-07-13T20:00:20Z","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":412374,"stargazers_count":9565,"watchers_count":9565,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2274,"mirror_url":null,"archived":false,"open_issues_count":4913,"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":2274,"open_issues":4913,"watchers":9565,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/28488"},"html":{"href":"https://github.com/dotnet/roslyn/pull/28488"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/28488"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/28488/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/28488/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/28488/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/93b6402d1b5862f0d7b2dbb5cbb04526bbe91fad"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"heejaechang"}}