{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/RTVS/pulls/comments/58233177","id":58233177,"diff_hunk":"@@ -0,0 +1,62 @@\n+using System;\n+using System.Threading;\n+using Microsoft.Common.Core;\n+using Microsoft.Internal.VisualStudio.PlatformUI;\n+using Microsoft.R.Components.Search;\n+using Microsoft.VisualStudio.PlatformUI;\n+using Microsoft.VisualStudio.Shell.Interop;\n+\n+namespace Microsoft.VisualStudio.R.Package.Search {\n+    internal class VsSearchControl : IVsWindowSearch, ISearchControl {\n+        private readonly IVsWindowSearchHost _vsWindowSearchHost;\n+        private readonly ISearchHandler _handler;\n+        private readonly SearchControlSettings _settings;\n+        private CancellationTokenSource _cts;\n+\n+        public VsSearchControl(IVsWindowSearchHost vsWindowSearchHost, ISearchHandler handler, SearchControlSettings settings) {\n+            Category = settings.SearchCategory;\n+            _settings = settings;\n+            _handler = handler;\n+            _vsWindowSearchHost = vsWindowSearchHost;\n+            _vsWindowSearchHost.SetupSearch(this);\n+        }\n+\n+        public IVsSearchTask CreateSearch(uint dwCookie, IVsSearchQuery pSearchQuery, IVsSearchCallback pSearchCallback) {\n+            var cts = new CancellationTokenSource();\n+            var oldCts = Interlocked.Exchange(ref _cts, cts);\n+            oldCts?.Cancel();\n+            return new VsSearchTask(dwCookie, pSearchQuery, pSearchCallback, _handler, cts);\n+        }\n+\n+        public void ClearSearch() {\n+            var cts = new CancellationTokenSource();\n+            var oldCts = Interlocked.Exchange(ref _cts, cts);\n+            oldCts?.Cancel();\n+            _handler.Search(string.Empty, cts.Token).DoNotWait();\n+        }\n+\n+        public void ProvideSearchSettings(IVsUIDataSource pSearchSettings) {\n+            var settings = (SearchSettingsDataSource)pSearchSettings;\n+            settings.SearchStartType = VSSEARCHSTARTTYPE.SST_INSTANT;\n+            SetIfSpecified(settings, SearchSettingsDataSource.ControlMinWidthProperty, nameof(SearchControlSettings.MinWidth));\n+            SetIfSpecified(settings, SearchSettingsDataSource.ControlMaxWidthProperty, nameof(SearchControlSettings.MaxWidth));\n+        } \n+\n+        private void SetIfSpecified(SearchSettingsDataSource vsSettings, GelProperty vsPropertyName, string propertyName) {\n+            object value;\n+            if (_settings.TryGetValue(propertyName, out value)) {\n+                vsSettings.SetValue(vsPropertyName, value);\n+            }\n+        }\n+\n+        public bool OnNavigationKeyDown(uint dwNavigationKey, uint dwModifiers) => false;\n+        public bool SearchEnabled => true;","path":"src/Package/Impl/Search/VsSearchControl.cs","position":53,"original_position":53,"commit_id":"d8bb3c17fe33007a44bbb9dfff4c8495856bd62c","original_commit_id":"d8bb3c17fe33007a44bbb9dfff4c8495856bd62c","user":{"login":"MikhailArkhipov","id":12820357,"avatar_url":"https://avatars.githubusercontent.com/u/12820357?v=3","gravatar_id":"","url":"https://api.github.com/users/MikhailArkhipov","html_url":"https://github.com/MikhailArkhipov","followers_url":"https://api.github.com/users/MikhailArkhipov/followers","following_url":"https://api.github.com/users/MikhailArkhipov/following{/other_user}","gists_url":"https://api.github.com/users/MikhailArkhipov/gists{/gist_id}","starred_url":"https://api.github.com/users/MikhailArkhipov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikhailArkhipov/subscriptions","organizations_url":"https://api.github.com/users/MikhailArkhipov/orgs","repos_url":"https://api.github.com/users/MikhailArkhipov/repos","events_url":"https://api.github.com/users/MikhailArkhipov/events{/privacy}","received_events_url":"https://api.github.com/users/MikhailArkhipov/received_events","type":"User","site_admin":false},"body":"OK, just checking","created_at":"2016-04-01T16:48:10Z","updated_at":"2016-04-01T16:48:10Z","html_url":"https://github.com/Microsoft/RTVS/pull/1395#discussion_r58233177","pull_request_url":"https://api.github.com/repos/Microsoft/RTVS/pulls/1395","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/RTVS/pulls/comments/58233177"},"html":{"href":"https://github.com/Microsoft/RTVS/pull/1395#discussion_r58233177"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/RTVS/pulls/1395"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/RTVS/pulls/1395","id":64959135,"html_url":"https://github.com/Microsoft/RTVS/pull/1395","diff_url":"https://github.com/Microsoft/RTVS/pull/1395.diff","patch_url":"https://github.com/Microsoft/RTVS/pull/1395.patch","issue_url":"https://api.github.com/repos/Microsoft/RTVS/issues/1395","number":1395,"state":"open","locked":false,"title":"Package manager UI","user":{"login":"AlexanderSher","id":8933858,"avatar_url":"https://avatars.githubusercontent.com/u/8933858?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderSher","html_url":"https://github.com/AlexanderSher","followers_url":"https://api.github.com/users/AlexanderSher/followers","following_url":"https://api.github.com/users/AlexanderSher/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderSher/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderSher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderSher/subscriptions","organizations_url":"https://api.github.com/users/AlexanderSher/orgs","repos_url":"https://api.github.com/users/AlexanderSher/repos","events_url":"https://api.github.com/users/AlexanderSher/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderSher/received_events","type":"User","site_admin":false},"body":"This PR doesn't address @huguesv's changes from yesterday, so \"avaliable packages\" tab and install/uninstall buttons aren't working yet.\r\n![packagemanager](https://cloud.githubusercontent.com/assets/8933858/14211371/a51e20e6-f7e2-11e5-93e2-16201eab4c59.png)\r\n","created_at":"2016-04-01T15:09:59Z","updated_at":"2016-04-01T16:48:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1a647fcfde891353177aa70c8f9515b3141fac10","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/RTVS/pulls/1395/commits","review_comments_url":"https://api.github.com/repos/Microsoft/RTVS/pulls/1395/comments","review_comment_url":"https://api.github.com/repos/Microsoft/RTVS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/RTVS/issues/1395/comments","statuses_url":"https://api.github.com/repos/Microsoft/RTVS/statuses/d8bb3c17fe33007a44bbb9dfff4c8495856bd62c","head":{"label":"AlexanderSher:Feature/PackageManager","ref":"Feature/PackageManager","sha":"d8bb3c17fe33007a44bbb9dfff4c8495856bd62c","user":{"login":"AlexanderSher","id":8933858,"avatar_url":"https://avatars.githubusercontent.com/u/8933858?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderSher","html_url":"https://github.com/AlexanderSher","followers_url":"https://api.github.com/users/AlexanderSher/followers","following_url":"https://api.github.com/users/AlexanderSher/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderSher/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderSher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderSher/subscriptions","organizations_url":"https://api.github.com/users/AlexanderSher/orgs","repos_url":"https://api.github.com/users/AlexanderSher/repos","events_url":"https://api.github.com/users/AlexanderSher/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderSher/received_events","type":"User","site_admin":false},"repo":{"id":53532014,"name":"RTVS","full_name":"AlexanderSher/RTVS","owner":{"login":"AlexanderSher","id":8933858,"avatar_url":"https://avatars.githubusercontent.com/u/8933858?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderSher","html_url":"https://github.com/AlexanderSher","followers_url":"https://api.github.com/users/AlexanderSher/followers","following_url":"https://api.github.com/users/AlexanderSher/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderSher/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderSher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderSher/subscriptions","organizations_url":"https://api.github.com/users/AlexanderSher/orgs","repos_url":"https://api.github.com/users/AlexanderSher/repos","events_url":"https://api.github.com/users/AlexanderSher/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderSher/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlexanderSher/RTVS","description":"R Tools for Visual Studio.","fork":true,"url":"https://api.github.com/repos/AlexanderSher/RTVS","forks_url":"https://api.github.com/repos/AlexanderSher/RTVS/forks","keys_url":"https://api.github.com/repos/AlexanderSher/RTVS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlexanderSher/RTVS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlexanderSher/RTVS/teams","hooks_url":"https://api.github.com/repos/AlexanderSher/RTVS/hooks","issue_events_url":"https://api.github.com/repos/AlexanderSher/RTVS/issues/events{/number}","events_url":"https://api.github.com/repos/AlexanderSher/RTVS/events","assignees_url":"https://api.github.com/repos/AlexanderSher/RTVS/assignees{/user}","branches_url":"https://api.github.com/repos/AlexanderSher/RTVS/branches{/branch}","tags_url":"https://api.github.com/repos/AlexanderSher/RTVS/tags","blobs_url":"https://api.github.com/repos/AlexanderSher/RTVS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlexanderSher/RTVS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlexanderSher/RTVS/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlexanderSher/RTVS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlexanderSher/RTVS/statuses/{sha}","languages_url":"https://api.github.com/repos/AlexanderSher/RTVS/languages","stargazers_url":"https://api.github.com/repos/AlexanderSher/RTVS/stargazers","contributors_url":"https://api.github.com/repos/AlexanderSher/RTVS/contributors","subscribers_url":"https://api.github.com/repos/AlexanderSher/RTVS/subscribers","subscription_url":"https://api.github.com/repos/AlexanderSher/RTVS/subscription","commits_url":"https://api.github.com/repos/AlexanderSher/RTVS/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlexanderSher/RTVS/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlexanderSher/RTVS/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlexanderSher/RTVS/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlexanderSher/RTVS/contents/{+path}","compare_url":"https://api.github.com/repos/AlexanderSher/RTVS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlexanderSher/RTVS/merges","archive_url":"https://api.github.com/repos/AlexanderSher/RTVS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlexanderSher/RTVS/downloads","issues_url":"https://api.github.com/repos/AlexanderSher/RTVS/issues{/number}","pulls_url":"https://api.github.com/repos/AlexanderSher/RTVS/pulls{/number}","milestones_url":"https://api.github.com/repos/AlexanderSher/RTVS/milestones{/number}","notifications_url":"https://api.github.com/repos/AlexanderSher/RTVS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlexanderSher/RTVS/labels{/name}","releases_url":"https://api.github.com/repos/AlexanderSher/RTVS/releases{/id}","deployments_url":"https://api.github.com/repos/AlexanderSher/RTVS/deployments","created_at":"2016-03-09T21:10:45Z","updated_at":"2016-03-09T21:10:54Z","pushed_at":"2016-04-01T15:06:22Z","git_url":"git://github.com/AlexanderSher/RTVS.git","ssh_url":"git@github.com:AlexanderSher/RTVS.git","clone_url":"https://github.com/AlexanderSher/RTVS.git","svn_url":"https://github.com/AlexanderSher/RTVS","homepage":null,"size":44397,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"08bedb34b685f42675663698de9b14e04c5c511e","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":38640473,"name":"RTVS","full_name":"Microsoft/RTVS","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/RTVS","description":"R Tools for Visual Studio.","fork":false,"url":"https://api.github.com/repos/Microsoft/RTVS","forks_url":"https://api.github.com/repos/Microsoft/RTVS/forks","keys_url":"https://api.github.com/repos/Microsoft/RTVS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/RTVS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/RTVS/teams","hooks_url":"https://api.github.com/repos/Microsoft/RTVS/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/RTVS/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/RTVS/events","assignees_url":"https://api.github.com/repos/Microsoft/RTVS/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/RTVS/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/RTVS/tags","blobs_url":"https://api.github.com/repos/Microsoft/RTVS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/RTVS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/RTVS/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/RTVS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/RTVS/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/RTVS/languages","stargazers_url":"https://api.github.com/repos/Microsoft/RTVS/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/RTVS/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/RTVS/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/RTVS/subscription","commits_url":"https://api.github.com/repos/Microsoft/RTVS/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/RTVS/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/RTVS/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/RTVS/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/RTVS/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/RTVS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/RTVS/merges","archive_url":"https://api.github.com/repos/Microsoft/RTVS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/RTVS/downloads","issues_url":"https://api.github.com/repos/Microsoft/RTVS/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/RTVS/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/RTVS/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/RTVS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/RTVS/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/RTVS/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/RTVS/deployments","created_at":"2015-07-06T19:14:09Z","updated_at":"2016-04-01T16:34:19Z","pushed_at":"2016-04-01T16:43:07Z","git_url":"git://github.com/Microsoft/RTVS.git","ssh_url":"git@github.com:Microsoft/RTVS.git","clone_url":"https://github.com/Microsoft/RTVS.git","svn_url":"https://github.com/Microsoft/RTVS","homepage":null,"size":44501,"stargazers_count":113,"watchers_count":113,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":230,"forks":21,"open_issues":230,"watchers":113,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/RTVS/pulls/1395"},"html":{"href":"https://github.com/Microsoft/RTVS/pull/1395"},"issue":{"href":"https://api.github.com/repos/Microsoft/RTVS/issues/1395"},"comments":{"href":"https://api.github.com/repos/Microsoft/RTVS/issues/1395/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/RTVS/pulls/1395/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/RTVS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/RTVS/pulls/1395/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/RTVS/statuses/d8bb3c17fe33007a44bbb9dfff4c8495856bd62c"}}}}