{"action":"created","comment":{"url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments/44876065","id":44876065,"diff_hunk":"@@ -20,60 +20,91 @@ public class TabCompletionLogic : ChromeLogic\n \t\tIList<string> candidates = new List<string>();\n \t\tint currentCandidateIndex = 0;\n \t\tstring lastCompleted;\n+\t\tpublic readonly string PrefixOnStart;\n+\t\tpublic readonly string SuffixOnStart;\n \t\tstring prefix;\n \t\tstring suffix;\n \n-\t\tpublic IList<string> Commands { get; set; }\n+\t\tint longestElementLength;\n+\t\tIList<string> universe;\n+\t\tpublic IList<string> Universe","path":"OpenRA.Mods.Common/Widgets/Logic/TabCompletionLogic.cs","position":12,"original_position":12,"commit_id":"2319b70dd6c4f6eef39778157a9ce710f6d296b0","original_commit_id":"2319b70dd6c4f6eef39778157a9ce710f6d296b0","user":{"login":"pchote","id":167819,"avatar_url":"https://avatars.githubusercontent.com/u/167819?v=3","gravatar_id":"","url":"https://api.github.com/users/pchote","html_url":"https://github.com/pchote","followers_url":"https://api.github.com/users/pchote/followers","following_url":"https://api.github.com/users/pchote/following{/other_user}","gists_url":"https://api.github.com/users/pchote/gists{/gist_id}","starred_url":"https://api.github.com/users/pchote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pchote/subscriptions","organizations_url":"https://api.github.com/users/pchote/orgs","repos_url":"https://api.github.com/users/pchote/repos","events_url":"https://api.github.com/users/pchote/events{/privacy}","received_events_url":"https://api.github.com/users/pchote/received_events","type":"User","site_admin":false},"body":"`Completions` sounds good to me.  It is descriptive and unambigous.","created_at":"2015-11-15T19:13:53Z","updated_at":"2015-11-15T19:13:53Z","html_url":"https://github.com/OpenRA/OpenRA/pull/9610#discussion_r44876065","pull_request_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/9610","_links":{"self":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments/44876065"},"html":{"href":"https://github.com/OpenRA/OpenRA/pull/9610#discussion_r44876065"},"pull_request":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/9610"}}},"pull_request":{"url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/9610","id":47375040,"html_url":"https://github.com/OpenRA/OpenRA/pull/9610","diff_url":"https://github.com/OpenRA/OpenRA/pull/9610.diff","patch_url":"https://github.com/OpenRA/OpenRA/pull/9610.patch","issue_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/9610","number":9610,"state":"open","locked":false,"title":"Tab completion improvement/rewriteish","user":{"login":"ChaoticMind","id":395384,"avatar_url":"https://avatars.githubusercontent.com/u/395384?v=3","gravatar_id":"","url":"https://api.github.com/users/ChaoticMind","html_url":"https://github.com/ChaoticMind","followers_url":"https://api.github.com/users/ChaoticMind/followers","following_url":"https://api.github.com/users/ChaoticMind/following{/other_user}","gists_url":"https://api.github.com/users/ChaoticMind/gists{/gist_id}","starred_url":"https://api.github.com/users/ChaoticMind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChaoticMind/subscriptions","organizations_url":"https://api.github.com/users/ChaoticMind/orgs","repos_url":"https://api.github.com/users/ChaoticMind/repos","events_url":"https://api.github.com/users/ChaoticMind/events{/privacy}","received_events_url":"https://api.github.com/users/ChaoticMind/received_events","type":"User","site_admin":false},"body":"Tab completion can now properly handle elements (most likely usernames) with whitespace. Previously, if someone had a nickname \"I like lamp\", and one types \"I li+tab\", it wouldn't work. Another pet peeve tackled!\r\n\r\nI'm not super satisfied with it because I would have liked to avoid rebuilding `relevantSubstrings`, but I didn't really find a more elegant solution. (Suggestions welcome). It might be impossible though because of the immutability of strings and the not-worthiness of having a \"startsWith()\" helper function that works on char arrays.\r\nIt's O(n*m) (worst case) where m is the average length of the possible elements (nicknames).\r\n\r\nI rewrote a good section of the class to increasing modularity and reduce the need to handle corner cases (although some remnants linger). Commands and Names are now in different `TabCompletionLogic` objects.","created_at":"2015-10-11T20:46:26Z","updated_at":"2015-11-15T19:13:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"06edf6d4df309aadd03ba52c6e6463b198ffc9f1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/9610/commits","review_comments_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/9610/comments","review_comment_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/9610/comments","statuses_url":"https://api.github.com/repos/OpenRA/OpenRA/statuses/2319b70dd6c4f6eef39778157a9ce710f6d296b0","head":{"label":"ChaoticMind:tab_completion","ref":"tab_completion","sha":"2319b70dd6c4f6eef39778157a9ce710f6d296b0","user":{"login":"ChaoticMind","id":395384,"avatar_url":"https://avatars.githubusercontent.com/u/395384?v=3","gravatar_id":"","url":"https://api.github.com/users/ChaoticMind","html_url":"https://github.com/ChaoticMind","followers_url":"https://api.github.com/users/ChaoticMind/followers","following_url":"https://api.github.com/users/ChaoticMind/following{/other_user}","gists_url":"https://api.github.com/users/ChaoticMind/gists{/gist_id}","starred_url":"https://api.github.com/users/ChaoticMind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChaoticMind/subscriptions","organizations_url":"https://api.github.com/users/ChaoticMind/orgs","repos_url":"https://api.github.com/users/ChaoticMind/repos","events_url":"https://api.github.com/users/ChaoticMind/events{/privacy}","received_events_url":"https://api.github.com/users/ChaoticMind/received_events","type":"User","site_admin":false},"repo":{"id":41763131,"name":"OpenRA","full_name":"ChaoticMind/OpenRA","owner":{"login":"ChaoticMind","id":395384,"avatar_url":"https://avatars.githubusercontent.com/u/395384?v=3","gravatar_id":"","url":"https://api.github.com/users/ChaoticMind","html_url":"https://github.com/ChaoticMind","followers_url":"https://api.github.com/users/ChaoticMind/followers","following_url":"https://api.github.com/users/ChaoticMind/following{/other_user}","gists_url":"https://api.github.com/users/ChaoticMind/gists{/gist_id}","starred_url":"https://api.github.com/users/ChaoticMind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChaoticMind/subscriptions","organizations_url":"https://api.github.com/users/ChaoticMind/orgs","repos_url":"https://api.github.com/users/ChaoticMind/repos","events_url":"https://api.github.com/users/ChaoticMind/events{/privacy}","received_events_url":"https://api.github.com/users/ChaoticMind/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ChaoticMind/OpenRA","description":"Open Source real-time strategy game engine for early Westwood games such as Command & Conquer: Red Alert written in C# using SDL and OpenGL. Runs on Windows, Linux, *BSD and Mac OS X.","fork":true,"url":"https://api.github.com/repos/ChaoticMind/OpenRA","forks_url":"https://api.github.com/repos/ChaoticMind/OpenRA/forks","keys_url":"https://api.github.com/repos/ChaoticMind/OpenRA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ChaoticMind/OpenRA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ChaoticMind/OpenRA/teams","hooks_url":"https://api.github.com/repos/ChaoticMind/OpenRA/hooks","issue_events_url":"https://api.github.com/repos/ChaoticMind/OpenRA/issues/events{/number}","events_url":"https://api.github.com/repos/ChaoticMind/OpenRA/events","assignees_url":"https://api.github.com/repos/ChaoticMind/OpenRA/assignees{/user}","branches_url":"https://api.github.com/repos/ChaoticMind/OpenRA/branches{/branch}","tags_url":"https://api.github.com/repos/ChaoticMind/OpenRA/tags","blobs_url":"https://api.github.com/repos/ChaoticMind/OpenRA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ChaoticMind/OpenRA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ChaoticMind/OpenRA/git/refs{/sha}","trees_url":"https://api.github.com/repos/ChaoticMind/OpenRA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ChaoticMind/OpenRA/statuses/{sha}","languages_url":"https://api.github.com/repos/ChaoticMind/OpenRA/languages","stargazers_url":"https://api.github.com/repos/ChaoticMind/OpenRA/stargazers","contributors_url":"https://api.github.com/repos/ChaoticMind/OpenRA/contributors","subscribers_url":"https://api.github.com/repos/ChaoticMind/OpenRA/subscribers","subscription_url":"https://api.github.com/repos/ChaoticMind/OpenRA/subscription","commits_url":"https://api.github.com/repos/ChaoticMind/OpenRA/commits{/sha}","git_commits_url":"https://api.github.com/repos/ChaoticMind/OpenRA/git/commits{/sha}","comments_url":"https://api.github.com/repos/ChaoticMind/OpenRA/comments{/number}","issue_comment_url":"https://api.github.com/repos/ChaoticMind/OpenRA/issues/comments{/number}","contents_url":"https://api.github.com/repos/ChaoticMind/OpenRA/contents/{+path}","compare_url":"https://api.github.com/repos/ChaoticMind/OpenRA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ChaoticMind/OpenRA/merges","archive_url":"https://api.github.com/repos/ChaoticMind/OpenRA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ChaoticMind/OpenRA/downloads","issues_url":"https://api.github.com/repos/ChaoticMind/OpenRA/issues{/number}","pulls_url":"https://api.github.com/repos/ChaoticMind/OpenRA/pulls{/number}","milestones_url":"https://api.github.com/repos/ChaoticMind/OpenRA/milestones{/number}","notifications_url":"https://api.github.com/repos/ChaoticMind/OpenRA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ChaoticMind/OpenRA/labels{/name}","releases_url":"https://api.github.com/repos/ChaoticMind/OpenRA/releases{/id}","created_at":"2015-09-01T21:00:49Z","updated_at":"2015-09-01T21:00:55Z","pushed_at":"2015-11-15T14:13:13Z","git_url":"git://github.com/ChaoticMind/OpenRA.git","ssh_url":"git@github.com:ChaoticMind/OpenRA.git","clone_url":"https://github.com/ChaoticMind/OpenRA.git","svn_url":"https://github.com/ChaoticMind/OpenRA","homepage":"http://www.openra.net","size":96096,"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":"bleed"}},"base":{"label":"OpenRA:bleed","ref":"bleed","sha":"7d2c86d75b3924423f8c46d1cc7447ab109db872","user":{"login":"OpenRA","id":409046,"avatar_url":"https://avatars.githubusercontent.com/u/409046?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenRA","html_url":"https://github.com/OpenRA","followers_url":"https://api.github.com/users/OpenRA/followers","following_url":"https://api.github.com/users/OpenRA/following{/other_user}","gists_url":"https://api.github.com/users/OpenRA/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenRA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenRA/subscriptions","organizations_url":"https://api.github.com/users/OpenRA/orgs","repos_url":"https://api.github.com/users/OpenRA/repos","events_url":"https://api.github.com/users/OpenRA/events{/privacy}","received_events_url":"https://api.github.com/users/OpenRA/received_events","type":"Organization","site_admin":false},"repo":{"id":959908,"name":"OpenRA","full_name":"OpenRA/OpenRA","owner":{"login":"OpenRA","id":409046,"avatar_url":"https://avatars.githubusercontent.com/u/409046?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenRA","html_url":"https://github.com/OpenRA","followers_url":"https://api.github.com/users/OpenRA/followers","following_url":"https://api.github.com/users/OpenRA/following{/other_user}","gists_url":"https://api.github.com/users/OpenRA/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenRA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenRA/subscriptions","organizations_url":"https://api.github.com/users/OpenRA/orgs","repos_url":"https://api.github.com/users/OpenRA/repos","events_url":"https://api.github.com/users/OpenRA/events{/privacy}","received_events_url":"https://api.github.com/users/OpenRA/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenRA/OpenRA","description":"Open Source real-time strategy game engine for early Westwood games such as Command & Conquer: Red Alert written in C# using SDL and OpenGL. Runs on Windows, Linux, *BSD and Mac OS X.","fork":false,"url":"https://api.github.com/repos/OpenRA/OpenRA","forks_url":"https://api.github.com/repos/OpenRA/OpenRA/forks","keys_url":"https://api.github.com/repos/OpenRA/OpenRA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenRA/OpenRA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenRA/OpenRA/teams","hooks_url":"https://api.github.com/repos/OpenRA/OpenRA/hooks","issue_events_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/events{/number}","events_url":"https://api.github.com/repos/OpenRA/OpenRA/events","assignees_url":"https://api.github.com/repos/OpenRA/OpenRA/assignees{/user}","branches_url":"https://api.github.com/repos/OpenRA/OpenRA/branches{/branch}","tags_url":"https://api.github.com/repos/OpenRA/OpenRA/tags","blobs_url":"https://api.github.com/repos/OpenRA/OpenRA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenRA/OpenRA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenRA/OpenRA/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenRA/OpenRA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenRA/OpenRA/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenRA/OpenRA/languages","stargazers_url":"https://api.github.com/repos/OpenRA/OpenRA/stargazers","contributors_url":"https://api.github.com/repos/OpenRA/OpenRA/contributors","subscribers_url":"https://api.github.com/repos/OpenRA/OpenRA/subscribers","subscription_url":"https://api.github.com/repos/OpenRA/OpenRA/subscription","commits_url":"https://api.github.com/repos/OpenRA/OpenRA/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenRA/OpenRA/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenRA/OpenRA/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenRA/OpenRA/contents/{+path}","compare_url":"https://api.github.com/repos/OpenRA/OpenRA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenRA/OpenRA/merges","archive_url":"https://api.github.com/repos/OpenRA/OpenRA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenRA/OpenRA/downloads","issues_url":"https://api.github.com/repos/OpenRA/OpenRA/issues{/number}","pulls_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenRA/OpenRA/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenRA/OpenRA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenRA/OpenRA/labels{/name}","releases_url":"https://api.github.com/repos/OpenRA/OpenRA/releases{/id}","created_at":"2010-10-04T07:38:05Z","updated_at":"2015-11-15T07:59:04Z","pushed_at":"2015-11-15T18:00:24Z","git_url":"git://github.com/OpenRA/OpenRA.git","ssh_url":"git@github.com:OpenRA/OpenRA.git","clone_url":"https://github.com/OpenRA/OpenRA.git","svn_url":"https://github.com/OpenRA/OpenRA","homepage":"http://www.openra.net","size":200424,"stargazers_count":2311,"watchers_count":2311,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":817,"mirror_url":null,"open_issues_count":993,"forks":817,"open_issues":993,"watchers":2311,"default_branch":"bleed"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/9610"},"html":{"href":"https://github.com/OpenRA/OpenRA/pull/9610"},"issue":{"href":"https://api.github.com/repos/OpenRA/OpenRA/issues/9610"},"comments":{"href":"https://api.github.com/repos/OpenRA/OpenRA/issues/9610/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/9610/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/9610/commits"},"statuses":{"href":"https://api.github.com/repos/OpenRA/OpenRA/statuses/2319b70dd6c4f6eef39778157a9ce710f6d296b0"}}}}