{"action":"created","comment":{"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/comments/48209456","id":48209456,"diff_hunk":"@@ -0,0 +1,229 @@\n+﻿using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using Rubberduck.Parsing.Grammar;\n+using Rubberduck.Parsing.Symbols;\n+using Rubberduck.Parsing.VBA;\n+using Rubberduck.UI;\n+using Rubberduck.VBEditor;\n+\n+namespace Rubberduck.Refactorings.MoveCloserToUsage\n+{\n+    public class MoveCloserToUsageRefactoring : IRefactoring\n+    {\n+        private readonly List<Declaration> _declarations;\n+        private readonly IActiveCodePaneEditor _editor;\n+        private readonly IMessageBox _messageBox;\n+\n+        public MoveCloserToUsageRefactoring(RubberduckParserState parseResult, IActiveCodePaneEditor editor, IMessageBox messageBox)\n+        {\n+            _declarations = parseResult.AllDeclarations.ToList();\n+            _editor = editor;\n+            _messageBox = messageBox;\n+        }\n+\n+        public void Refactor()\n+        {\n+            var qualifiedSelection = _editor.GetSelection();\n+            if (qualifiedSelection != null)\n+            {\n+                Refactor(FindSelection(qualifiedSelection.Value));\n+            }\n+            else\n+            {\n+                _messageBox.Show(\"Invalid Selection.\", \"Rubberduck - Move Closer To Usage\", System.Windows.Forms.MessageBoxButtons.OK,","path":"RetailCoder.VBE/Refactorings/MoveCloserToUsage/MoveCloserToUsageRefactoring.cs","position":34,"original_position":34,"commit_id":"752a110f194ff9dd0ecde99cb3998b073d918617","original_commit_id":"6896fb176dcd4937ede115507170f1a5671f1b46","user":{"login":"Hosch250","id":6299719,"avatar_url":"https://avatars.githubusercontent.com/u/6299719?v=3","gravatar_id":"","url":"https://api.github.com/users/Hosch250","html_url":"https://github.com/Hosch250","followers_url":"https://api.github.com/users/Hosch250/followers","following_url":"https://api.github.com/users/Hosch250/following{/other_user}","gists_url":"https://api.github.com/users/Hosch250/gists{/gist_id}","starred_url":"https://api.github.com/users/Hosch250/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hosch250/subscriptions","organizations_url":"https://api.github.com/users/Hosch250/orgs","repos_url":"https://api.github.com/users/Hosch250/repos","events_url":"https://api.github.com/users/Hosch250/events{/privacy}","received_events_url":"https://api.github.com/users/Hosch250/received_events","type":"User","site_admin":false},"body":"R# formatted that for me.","created_at":"2015-12-22T00:28:00Z","updated_at":"2015-12-22T00:28:00Z","html_url":"https://github.com/rubberduck-vba/Rubberduck/pull/886#discussion_r48209456","pull_request_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/886","_links":{"self":{"href":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/comments/48209456"},"html":{"href":"https://github.com/rubberduck-vba/Rubberduck/pull/886#discussion_r48209456"},"pull_request":{"href":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/886"}}},"pull_request":{"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/886","id":54318745,"html_url":"https://github.com/rubberduck-vba/Rubberduck/pull/886","diff_url":"https://github.com/rubberduck-vba/Rubberduck/pull/886.diff","patch_url":"https://github.com/rubberduck-vba/Rubberduck/pull/886.patch","issue_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/886","number":886,"state":"open","locked":false,"title":"Move closer to usage refactoring","user":{"login":"Hosch250","id":6299719,"avatar_url":"https://avatars.githubusercontent.com/u/6299719?v=3","gravatar_id":"","url":"https://api.github.com/users/Hosch250","html_url":"https://github.com/Hosch250","followers_url":"https://api.github.com/users/Hosch250/followers","following_url":"https://api.github.com/users/Hosch250/following{/other_user}","gists_url":"https://api.github.com/users/Hosch250/gists{/gist_id}","starred_url":"https://api.github.com/users/Hosch250/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hosch250/subscriptions","organizations_url":"https://api.github.com/users/Hosch250/orgs","repos_url":"https://api.github.com/users/Hosch250/repos","events_url":"https://api.github.com/users/Hosch250/events{/privacy}","received_events_url":"https://api.github.com/users/Hosch250/received_events","type":"User","site_admin":false},"body":"@retailcoder @Vogel612 @ckuhn203 And anyone else who is interested: Please review this when you have time.","created_at":"2015-12-22T00:11:10Z","updated_at":"2015-12-22T00:28:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"33975f20091131c312452e843273d1d67bbd185f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/886/commits","review_comments_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/886/comments","review_comment_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/886/comments","statuses_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/statuses/752a110f194ff9dd0ecde99cb3998b073d918617","head":{"label":"Hosch250:MoveCloserToUsageRefactoring","ref":"MoveCloserToUsageRefactoring","sha":"752a110f194ff9dd0ecde99cb3998b073d918617","user":{"login":"Hosch250","id":6299719,"avatar_url":"https://avatars.githubusercontent.com/u/6299719?v=3","gravatar_id":"","url":"https://api.github.com/users/Hosch250","html_url":"https://github.com/Hosch250","followers_url":"https://api.github.com/users/Hosch250/followers","following_url":"https://api.github.com/users/Hosch250/following{/other_user}","gists_url":"https://api.github.com/users/Hosch250/gists{/gist_id}","starred_url":"https://api.github.com/users/Hosch250/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hosch250/subscriptions","organizations_url":"https://api.github.com/users/Hosch250/orgs","repos_url":"https://api.github.com/users/Hosch250/repos","events_url":"https://api.github.com/users/Hosch250/events{/privacy}","received_events_url":"https://api.github.com/users/Hosch250/received_events","type":"User","site_admin":false},"repo":{"id":42262495,"name":"Rubberduck","full_name":"Hosch250/Rubberduck","owner":{"login":"Hosch250","id":6299719,"avatar_url":"https://avatars.githubusercontent.com/u/6299719?v=3","gravatar_id":"","url":"https://api.github.com/users/Hosch250","html_url":"https://github.com/Hosch250","followers_url":"https://api.github.com/users/Hosch250/followers","following_url":"https://api.github.com/users/Hosch250/following{/other_user}","gists_url":"https://api.github.com/users/Hosch250/gists{/gist_id}","starred_url":"https://api.github.com/users/Hosch250/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hosch250/subscriptions","organizations_url":"https://api.github.com/users/Hosch250/orgs","repos_url":"https://api.github.com/users/Hosch250/repos","events_url":"https://api.github.com/users/Hosch250/events{/privacy}","received_events_url":"https://api.github.com/users/Hosch250/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Hosch250/Rubberduck","description":"Every programmer needs a rubberduck. COM add-in for the VBA IDE (VBE).","fork":true,"url":"https://api.github.com/repos/Hosch250/Rubberduck","forks_url":"https://api.github.com/repos/Hosch250/Rubberduck/forks","keys_url":"https://api.github.com/repos/Hosch250/Rubberduck/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Hosch250/Rubberduck/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Hosch250/Rubberduck/teams","hooks_url":"https://api.github.com/repos/Hosch250/Rubberduck/hooks","issue_events_url":"https://api.github.com/repos/Hosch250/Rubberduck/issues/events{/number}","events_url":"https://api.github.com/repos/Hosch250/Rubberduck/events","assignees_url":"https://api.github.com/repos/Hosch250/Rubberduck/assignees{/user}","branches_url":"https://api.github.com/repos/Hosch250/Rubberduck/branches{/branch}","tags_url":"https://api.github.com/repos/Hosch250/Rubberduck/tags","blobs_url":"https://api.github.com/repos/Hosch250/Rubberduck/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Hosch250/Rubberduck/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Hosch250/Rubberduck/git/refs{/sha}","trees_url":"https://api.github.com/repos/Hosch250/Rubberduck/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Hosch250/Rubberduck/statuses/{sha}","languages_url":"https://api.github.com/repos/Hosch250/Rubberduck/languages","stargazers_url":"https://api.github.com/repos/Hosch250/Rubberduck/stargazers","contributors_url":"https://api.github.com/repos/Hosch250/Rubberduck/contributors","subscribers_url":"https://api.github.com/repos/Hosch250/Rubberduck/subscribers","subscription_url":"https://api.github.com/repos/Hosch250/Rubberduck/subscription","commits_url":"https://api.github.com/repos/Hosch250/Rubberduck/commits{/sha}","git_commits_url":"https://api.github.com/repos/Hosch250/Rubberduck/git/commits{/sha}","comments_url":"https://api.github.com/repos/Hosch250/Rubberduck/comments{/number}","issue_comment_url":"https://api.github.com/repos/Hosch250/Rubberduck/issues/comments{/number}","contents_url":"https://api.github.com/repos/Hosch250/Rubberduck/contents/{+path}","compare_url":"https://api.github.com/repos/Hosch250/Rubberduck/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Hosch250/Rubberduck/merges","archive_url":"https://api.github.com/repos/Hosch250/Rubberduck/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Hosch250/Rubberduck/downloads","issues_url":"https://api.github.com/repos/Hosch250/Rubberduck/issues{/number}","pulls_url":"https://api.github.com/repos/Hosch250/Rubberduck/pulls{/number}","milestones_url":"https://api.github.com/repos/Hosch250/Rubberduck/milestones{/number}","notifications_url":"https://api.github.com/repos/Hosch250/Rubberduck/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Hosch250/Rubberduck/labels{/name}","releases_url":"https://api.github.com/repos/Hosch250/Rubberduck/releases{/id}","created_at":"2015-09-10T18:22:56Z","updated_at":"2015-09-10T18:22:57Z","pushed_at":"2015-12-22T00:26:48Z","git_url":"git://github.com/Hosch250/Rubberduck.git","ssh_url":"git@github.com:Hosch250/Rubberduck.git","clone_url":"https://github.com/Hosch250/Rubberduck.git","svn_url":"https://github.com/Hosch250/Rubberduck","homepage":"","size":9708,"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":"next"}},"base":{"label":"rubberduck-vba:next","ref":"next","sha":"8c554f6a3d4911f9431d249df6ffeb8721056eb9","user":{"login":"rubberduck-vba","id":12832254,"avatar_url":"https://avatars.githubusercontent.com/u/12832254?v=3","gravatar_id":"","url":"https://api.github.com/users/rubberduck-vba","html_url":"https://github.com/rubberduck-vba","followers_url":"https://api.github.com/users/rubberduck-vba/followers","following_url":"https://api.github.com/users/rubberduck-vba/following{/other_user}","gists_url":"https://api.github.com/users/rubberduck-vba/gists{/gist_id}","starred_url":"https://api.github.com/users/rubberduck-vba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubberduck-vba/subscriptions","organizations_url":"https://api.github.com/users/rubberduck-vba/orgs","repos_url":"https://api.github.com/users/rubberduck-vba/repos","events_url":"https://api.github.com/users/rubberduck-vba/events{/privacy}","received_events_url":"https://api.github.com/users/rubberduck-vba/received_events","type":"Organization","site_admin":false},"repo":{"id":25800128,"name":"Rubberduck","full_name":"rubberduck-vba/Rubberduck","owner":{"login":"rubberduck-vba","id":12832254,"avatar_url":"https://avatars.githubusercontent.com/u/12832254?v=3","gravatar_id":"","url":"https://api.github.com/users/rubberduck-vba","html_url":"https://github.com/rubberduck-vba","followers_url":"https://api.github.com/users/rubberduck-vba/followers","following_url":"https://api.github.com/users/rubberduck-vba/following{/other_user}","gists_url":"https://api.github.com/users/rubberduck-vba/gists{/gist_id}","starred_url":"https://api.github.com/users/rubberduck-vba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubberduck-vba/subscriptions","organizations_url":"https://api.github.com/users/rubberduck-vba/orgs","repos_url":"https://api.github.com/users/rubberduck-vba/repos","events_url":"https://api.github.com/users/rubberduck-vba/events{/privacy}","received_events_url":"https://api.github.com/users/rubberduck-vba/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rubberduck-vba/Rubberduck","description":"Every programmer needs a rubberduck. COM add-in for the VBA IDE (VBE).","fork":false,"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck","forks_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/forks","keys_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/teams","hooks_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/hooks","issue_events_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/events{/number}","events_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/events","assignees_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/assignees{/user}","branches_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/branches{/branch}","tags_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/tags","blobs_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/git/refs{/sha}","trees_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/statuses/{sha}","languages_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/languages","stargazers_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/stargazers","contributors_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/contributors","subscribers_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/subscribers","subscription_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/subscription","commits_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/commits{/sha}","git_commits_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/git/commits{/sha}","comments_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/comments{/number}","issue_comment_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/comments{/number}","contents_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/contents/{+path}","compare_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/merges","archive_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/downloads","issues_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues{/number}","pulls_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls{/number}","milestones_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/milestones{/number}","notifications_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/labels{/name}","releases_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/releases{/id}","created_at":"2014-10-27T02:35:11Z","updated_at":"2015-12-15T20:32:04Z","pushed_at":"2015-12-22T00:26:48Z","git_url":"git://github.com/rubberduck-vba/Rubberduck.git","ssh_url":"git@github.com:rubberduck-vba/Rubberduck.git","clone_url":"https://github.com/rubberduck-vba/Rubberduck.git","svn_url":"https://github.com/rubberduck-vba/Rubberduck","homepage":"","size":10510,"stargazers_count":133,"watchers_count":133,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":43,"mirror_url":null,"open_issues_count":143,"forks":43,"open_issues":143,"watchers":133,"default_branch":"next"}},"_links":{"self":{"href":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/886"},"html":{"href":"https://github.com/rubberduck-vba/Rubberduck/pull/886"},"issue":{"href":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/886"},"comments":{"href":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/886/comments"},"review_comments":{"href":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/886/comments"},"review_comment":{"href":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/886/commits"},"statuses":{"href":"https://api.github.com/repos/rubberduck-vba/Rubberduck/statuses/752a110f194ff9dd0ecde99cb3998b073d918617"}}}}