{"action":"created","comment":{"url":"https://api.github.com/repos/atom-community/autocomplete-plus/pulls/comments/22880022","id":22880022,"diff_hunk":"@@ -188,66 +116,46 @@ class AutocompleteManager\n \n     # No suggestions? Cancel autocompletion.\n     return unless suggestions.length\n+    @suggestionList?.changeItems(suggestions)\n+    @showSuggestionList()\n+\n+  providersForScopes: (scopes) =>\n+    return [] unless scopes?\n+    return [] unless @scopes\n+    providers = []\n+    for scope in scopes\n+      if @scopes[scope]?\n+        providers = _.union(providers, @scopes[scope])\n+    providers.push(@fuzzyProvider) unless _.size(providers) > 0\n+    providers\n \n-    unless @overlayDecoration?\n-      marker = @editor.getLastCursor()?.getMarker()\n-      @overlayDecoration = @editor?.decorateMarker(marker, { type: 'overlay', item: this })\n-\n-    # Now we're ready - display the suggestions\n-    @changeItems suggestions\n-\n-    @setActive()\n-\n-  changeItems: (items) ->\n-    @items = items\n-    @emitter.emit 'did-change-items', items\n-\n-  onDidChangeItems: (cb) ->\n-    @emitter.on 'did-change-items', cb\n-\n-  # Private: Focuses the hidden input, starts listening to keyboard events\n-  setActive: ->\n-    @addKeyboardInteraction()\n-    @active = true\n+  # Private: Gets called when the user successfully confirms a suggestion\n+  #\n+  # match - An {Object} representing the confirmed suggestion\n+  confirm: (match) =>\n+    return unless @editorHasFocus()\n+    return unless match?.provider?","path":"lib/autocomplete-manager.coffee","position":304,"original_position":300,"commit_id":"2f7b102671b2dc670976673b9f9753d27dfa23d0","original_commit_id":"1be99bb634ef6137b2070d849fe9cd4cda222de5","user":{"login":"joefitzgerald","id":744740,"avatar_url":"https://avatars.githubusercontent.com/u/744740?v=3","gravatar_id":"","url":"https://api.github.com/users/joefitzgerald","html_url":"https://github.com/joefitzgerald","followers_url":"https://api.github.com/users/joefitzgerald/followers","following_url":"https://api.github.com/users/joefitzgerald/following{/other_user}","gists_url":"https://api.github.com/users/joefitzgerald/gists{/gist_id}","starred_url":"https://api.github.com/users/joefitzgerald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joefitzgerald/subscriptions","organizations_url":"https://api.github.com/users/joefitzgerald/orgs","repos_url":"https://api.github.com/users/joefitzgerald/repos","events_url":"https://api.github.com/users/joefitzgerald/events{/privacy}","received_events_url":"https://api.github.com/users/joefitzgerald/received_events","type":"User","site_admin":false},"body":"You'd be surprised how often it occurs during development of a new provider. This will likely change soon, as we're going to switch to a non-`Provider` (class) based approach.","created_at":"2015-01-13T17:54:12Z","updated_at":"2015-01-13T17:54:12Z","html_url":"https://github.com/atom-community/autocomplete-plus/pull/186#discussion_r22880022","pull_request_url":"https://api.github.com/repos/atom-community/autocomplete-plus/pulls/186","_links":{"self":{"href":"https://api.github.com/repos/atom-community/autocomplete-plus/pulls/comments/22880022"},"html":{"href":"https://github.com/atom-community/autocomplete-plus/pull/186#discussion_r22880022"},"pull_request":{"href":"https://api.github.com/repos/atom-community/autocomplete-plus/pulls/186"}}},"pull_request":{"url":"https://api.github.com/repos/atom-community/autocomplete-plus/pulls/186","id":26735073,"html_url":"https://github.com/atom-community/autocomplete-plus/pull/186","diff_url":"https://github.com/atom-community/autocomplete-plus/pull/186.diff","patch_url":"https://github.com/atom-community/autocomplete-plus/pull/186.patch","issue_url":"https://api.github.com/repos/atom-community/autocomplete-plus/issues/186","number":186,"state":"open","locked":false,"title":"Singleton AutocompleteManager, Separate View's Model From AutocompleteManager","user":{"login":"joefitzgerald","id":744740,"avatar_url":"https://avatars.githubusercontent.com/u/744740?v=3","gravatar_id":"","url":"https://api.github.com/users/joefitzgerald","html_url":"https://github.com/joefitzgerald","followers_url":"https://api.github.com/users/joefitzgerald/followers","following_url":"https://api.github.com/users/joefitzgerald/following{/other_user}","gists_url":"https://api.github.com/users/joefitzgerald/gists{/gist_id}","starred_url":"https://api.github.com/users/joefitzgerald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joefitzgerald/subscriptions","organizations_url":"https://api.github.com/users/joefitzgerald/orgs","repos_url":"https://api.github.com/users/joefitzgerald/repos","events_url":"https://api.github.com/users/joefitzgerald/events{/privacy}","received_events_url":"https://api.github.com/users/joefitzgerald/received_events","type":"User","site_admin":false},"body":":rotating_light: WIP - Not Ready For Merge :rotating_light: \r\n\r\nThis PR seeks to change `autocomplete-plus` such that `AutocompleteManager` is a singleton.\r\n\r\n- [x] Rename `select-list-element` to `suggestion-list-element`\r\n- [x] Add `suggestion-list`\r\n- [x] Modify `main.coffee` to manage a single `AutocompleteManager` instance\r\n- [x] Track providers in an associative array, associating providers with scopes\r\n- [x] Modify provider registration functions to discard editor binding during provider registration\r\n- [x] Determine scope(s) for editor provided during provider registration\r\n- [x] Manage `suggestion-list-element` across editors\r\n- [ ] Ensure decoration and view migrate across editors without problems\r\n- [ ] Ensure autocomplete doesn't trigger during composition\r\n- [ ] Make modest FuzzyProvider enhancements\r\n\r\n:rotating_light: WIP - Not Ready For Merge :rotating_light: \r\n\r\nThis PR contributes to completion of #184.","created_at":"2014-12-31T20:44:07Z","updated_at":"2015-01-13T17:54:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2db7a29636e4ecf823edf6a4c21c475cbcc19b9c","assignee":{"login":"joefitzgerald","id":744740,"avatar_url":"https://avatars.githubusercontent.com/u/744740?v=3","gravatar_id":"","url":"https://api.github.com/users/joefitzgerald","html_url":"https://github.com/joefitzgerald","followers_url":"https://api.github.com/users/joefitzgerald/followers","following_url":"https://api.github.com/users/joefitzgerald/following{/other_user}","gists_url":"https://api.github.com/users/joefitzgerald/gists{/gist_id}","starred_url":"https://api.github.com/users/joefitzgerald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joefitzgerald/subscriptions","organizations_url":"https://api.github.com/users/joefitzgerald/orgs","repos_url":"https://api.github.com/users/joefitzgerald/repos","events_url":"https://api.github.com/users/joefitzgerald/events{/privacy}","received_events_url":"https://api.github.com/users/joefitzgerald/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/atom-community/autocomplete-plus/milestones/2","labels_url":"https://api.github.com/repos/atom-community/autocomplete-plus/milestones/2/labels","id":918138,"number":2,"title":"2.0","description":"","creator":{"login":"joefitzgerald","id":744740,"avatar_url":"https://avatars.githubusercontent.com/u/744740?v=3","gravatar_id":"","url":"https://api.github.com/users/joefitzgerald","html_url":"https://github.com/joefitzgerald","followers_url":"https://api.github.com/users/joefitzgerald/followers","following_url":"https://api.github.com/users/joefitzgerald/following{/other_user}","gists_url":"https://api.github.com/users/joefitzgerald/gists{/gist_id}","starred_url":"https://api.github.com/users/joefitzgerald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joefitzgerald/subscriptions","organizations_url":"https://api.github.com/users/joefitzgerald/orgs","repos_url":"https://api.github.com/users/joefitzgerald/repos","events_url":"https://api.github.com/users/joefitzgerald/events{/privacy}","received_events_url":"https://api.github.com/users/joefitzgerald/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":0,"state":"open","created_at":"2014-12-31T00:03:24Z","updated_at":"2015-01-05T05:47:14Z","due_on":"2015-01-10T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/atom-community/autocomplete-plus/pulls/186/commits","review_comments_url":"https://api.github.com/repos/atom-community/autocomplete-plus/pulls/186/comments","review_comment_url":"https://api.github.com/repos/atom-community/autocomplete-plus/pulls/comments/{number}","comments_url":"https://api.github.com/repos/atom-community/autocomplete-plus/issues/186/comments","statuses_url":"https://api.github.com/repos/atom-community/autocomplete-plus/statuses/2f7b102671b2dc670976673b9f9753d27dfa23d0","head":{"label":"atom-community:singleton-autocomplete-manager","ref":"singleton-autocomplete-manager","sha":"2f7b102671b2dc670976673b9f9753d27dfa23d0","user":{"login":"atom-community","id":9948688,"avatar_url":"https://avatars.githubusercontent.com/u/9948688?v=3","gravatar_id":"","url":"https://api.github.com/users/atom-community","html_url":"https://github.com/atom-community","followers_url":"https://api.github.com/users/atom-community/followers","following_url":"https://api.github.com/users/atom-community/following{/other_user}","gists_url":"https://api.github.com/users/atom-community/gists{/gist_id}","starred_url":"https://api.github.com/users/atom-community/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom-community/subscriptions","organizations_url":"https://api.github.com/users/atom-community/orgs","repos_url":"https://api.github.com/users/atom-community/repos","events_url":"https://api.github.com/users/atom-community/events{/privacy}","received_events_url":"https://api.github.com/users/atom-community/received_events","type":"Organization","site_admin":false},"repo":{"id":17254728,"name":"autocomplete-plus","full_name":"atom-community/autocomplete-plus","owner":{"login":"atom-community","id":9948688,"avatar_url":"https://avatars.githubusercontent.com/u/9948688?v=3","gravatar_id":"","url":"https://api.github.com/users/atom-community","html_url":"https://github.com/atom-community","followers_url":"https://api.github.com/users/atom-community/followers","following_url":"https://api.github.com/users/atom-community/following{/other_user}","gists_url":"https://api.github.com/users/atom-community/gists{/gist_id}","starred_url":"https://api.github.com/users/atom-community/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom-community/subscriptions","organizations_url":"https://api.github.com/users/atom-community/orgs","repos_url":"https://api.github.com/users/atom-community/repos","events_url":"https://api.github.com/users/atom-community/events{/privacy}","received_events_url":"https://api.github.com/users/atom-community/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/atom-community/autocomplete-plus","description":"View and insert possible completions in the editor while typing","fork":true,"url":"https://api.github.com/repos/atom-community/autocomplete-plus","forks_url":"https://api.github.com/repos/atom-community/autocomplete-plus/forks","keys_url":"https://api.github.com/repos/atom-community/autocomplete-plus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atom-community/autocomplete-plus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atom-community/autocomplete-plus/teams","hooks_url":"https://api.github.com/repos/atom-community/autocomplete-plus/hooks","issue_events_url":"https://api.github.com/repos/atom-community/autocomplete-plus/issues/events{/number}","events_url":"https://api.github.com/repos/atom-community/autocomplete-plus/events","assignees_url":"https://api.github.com/repos/atom-community/autocomplete-plus/assignees{/user}","branches_url":"https://api.github.com/repos/atom-community/autocomplete-plus/branches{/branch}","tags_url":"https://api.github.com/repos/atom-community/autocomplete-plus/tags","blobs_url":"https://api.github.com/repos/atom-community/autocomplete-plus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atom-community/autocomplete-plus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atom-community/autocomplete-plus/git/refs{/sha}","trees_url":"https://api.github.com/repos/atom-community/autocomplete-plus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atom-community/autocomplete-plus/statuses/{sha}","languages_url":"https://api.github.com/repos/atom-community/autocomplete-plus/languages","stargazers_url":"https://api.github.com/repos/atom-community/autocomplete-plus/stargazers","contributors_url":"https://api.github.com/repos/atom-community/autocomplete-plus/contributors","subscribers_url":"https://api.github.com/repos/atom-community/autocomplete-plus/subscribers","subscription_url":"https://api.github.com/repos/atom-community/autocomplete-plus/subscription","commits_url":"https://api.github.com/repos/atom-community/autocomplete-plus/commits{/sha}","git_commits_url":"https://api.github.com/repos/atom-community/autocomplete-plus/git/commits{/sha}","comments_url":"https://api.github.com/repos/atom-community/autocomplete-plus/comments{/number}","issue_comment_url":"https://api.github.com/repos/atom-community/autocomplete-plus/issues/comments/{number}","contents_url":"https://api.github.com/repos/atom-community/autocomplete-plus/contents/{+path}","compare_url":"https://api.github.com/repos/atom-community/autocomplete-plus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atom-community/autocomplete-plus/merges","archive_url":"https://api.github.com/repos/atom-community/autocomplete-plus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atom-community/autocomplete-plus/downloads","issues_url":"https://api.github.com/repos/atom-community/autocomplete-plus/issues{/number}","pulls_url":"https://api.github.com/repos/atom-community/autocomplete-plus/pulls{/number}","milestones_url":"https://api.github.com/repos/atom-community/autocomplete-plus/milestones{/number}","notifications_url":"https://api.github.com/repos/atom-community/autocomplete-plus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atom-community/autocomplete-plus/labels{/name}","releases_url":"https://api.github.com/repos/atom-community/autocomplete-plus/releases{/id}","created_at":"2014-02-27T16:03:36Z","updated_at":"2015-01-10T12:30:51Z","pushed_at":"2015-01-13T17:49:08Z","git_url":"git://github.com/atom-community/autocomplete-plus.git","ssh_url":"git@github.com:atom-community/autocomplete-plus.git","clone_url":"https://github.com/atom-community/autocomplete-plus.git","svn_url":"https://github.com/atom-community/autocomplete-plus","homepage":"","size":2001,"stargazers_count":163,"watchers_count":163,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":21,"forks":34,"open_issues":21,"watchers":163,"default_branch":"master"}},"base":{"label":"atom-community:master","ref":"master","sha":"8b0af627627a04d22ea6388dc320ab41b42ba5ce","user":{"login":"atom-community","id":9948688,"avatar_url":"https://avatars.githubusercontent.com/u/9948688?v=3","gravatar_id":"","url":"https://api.github.com/users/atom-community","html_url":"https://github.com/atom-community","followers_url":"https://api.github.com/users/atom-community/followers","following_url":"https://api.github.com/users/atom-community/following{/other_user}","gists_url":"https://api.github.com/users/atom-community/gists{/gist_id}","starred_url":"https://api.github.com/users/atom-community/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom-community/subscriptions","organizations_url":"https://api.github.com/users/atom-community/orgs","repos_url":"https://api.github.com/users/atom-community/repos","events_url":"https://api.github.com/users/atom-community/events{/privacy}","received_events_url":"https://api.github.com/users/atom-community/received_events","type":"Organization","site_admin":false},"repo":{"id":17254728,"name":"autocomplete-plus","full_name":"atom-community/autocomplete-plus","owner":{"login":"atom-community","id":9948688,"avatar_url":"https://avatars.githubusercontent.com/u/9948688?v=3","gravatar_id":"","url":"https://api.github.com/users/atom-community","html_url":"https://github.com/atom-community","followers_url":"https://api.github.com/users/atom-community/followers","following_url":"https://api.github.com/users/atom-community/following{/other_user}","gists_url":"https://api.github.com/users/atom-community/gists{/gist_id}","starred_url":"https://api.github.com/users/atom-community/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom-community/subscriptions","organizations_url":"https://api.github.com/users/atom-community/orgs","repos_url":"https://api.github.com/users/atom-community/repos","events_url":"https://api.github.com/users/atom-community/events{/privacy}","received_events_url":"https://api.github.com/users/atom-community/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/atom-community/autocomplete-plus","description":"View and insert possible completions in the editor while typing","fork":true,"url":"https://api.github.com/repos/atom-community/autocomplete-plus","forks_url":"https://api.github.com/repos/atom-community/autocomplete-plus/forks","keys_url":"https://api.github.com/repos/atom-community/autocomplete-plus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atom-community/autocomplete-plus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atom-community/autocomplete-plus/teams","hooks_url":"https://api.github.com/repos/atom-community/autocomplete-plus/hooks","issue_events_url":"https://api.github.com/repos/atom-community/autocomplete-plus/issues/events{/number}","events_url":"https://api.github.com/repos/atom-community/autocomplete-plus/events","assignees_url":"https://api.github.com/repos/atom-community/autocomplete-plus/assignees{/user}","branches_url":"https://api.github.com/repos/atom-community/autocomplete-plus/branches{/branch}","tags_url":"https://api.github.com/repos/atom-community/autocomplete-plus/tags","blobs_url":"https://api.github.com/repos/atom-community/autocomplete-plus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atom-community/autocomplete-plus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atom-community/autocomplete-plus/git/refs{/sha}","trees_url":"https://api.github.com/repos/atom-community/autocomplete-plus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atom-community/autocomplete-plus/statuses/{sha}","languages_url":"https://api.github.com/repos/atom-community/autocomplete-plus/languages","stargazers_url":"https://api.github.com/repos/atom-community/autocomplete-plus/stargazers","contributors_url":"https://api.github.com/repos/atom-community/autocomplete-plus/contributors","subscribers_url":"https://api.github.com/repos/atom-community/autocomplete-plus/subscribers","subscription_url":"https://api.github.com/repos/atom-community/autocomplete-plus/subscription","commits_url":"https://api.github.com/repos/atom-community/autocomplete-plus/commits{/sha}","git_commits_url":"https://api.github.com/repos/atom-community/autocomplete-plus/git/commits{/sha}","comments_url":"https://api.github.com/repos/atom-community/autocomplete-plus/comments{/number}","issue_comment_url":"https://api.github.com/repos/atom-community/autocomplete-plus/issues/comments/{number}","contents_url":"https://api.github.com/repos/atom-community/autocomplete-plus/contents/{+path}","compare_url":"https://api.github.com/repos/atom-community/autocomplete-plus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atom-community/autocomplete-plus/merges","archive_url":"https://api.github.com/repos/atom-community/autocomplete-plus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atom-community/autocomplete-plus/downloads","issues_url":"https://api.github.com/repos/atom-community/autocomplete-plus/issues{/number}","pulls_url":"https://api.github.com/repos/atom-community/autocomplete-plus/pulls{/number}","milestones_url":"https://api.github.com/repos/atom-community/autocomplete-plus/milestones{/number}","notifications_url":"https://api.github.com/repos/atom-community/autocomplete-plus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atom-community/autocomplete-plus/labels{/name}","releases_url":"https://api.github.com/repos/atom-community/autocomplete-plus/releases{/id}","created_at":"2014-02-27T16:03:36Z","updated_at":"2015-01-10T12:30:51Z","pushed_at":"2015-01-13T17:49:08Z","git_url":"git://github.com/atom-community/autocomplete-plus.git","ssh_url":"git@github.com:atom-community/autocomplete-plus.git","clone_url":"https://github.com/atom-community/autocomplete-plus.git","svn_url":"https://github.com/atom-community/autocomplete-plus","homepage":"","size":2001,"stargazers_count":163,"watchers_count":163,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":21,"forks":34,"open_issues":21,"watchers":163,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/atom-community/autocomplete-plus/pulls/186"},"html":{"href":"https://github.com/atom-community/autocomplete-plus/pull/186"},"issue":{"href":"https://api.github.com/repos/atom-community/autocomplete-plus/issues/186"},"comments":{"href":"https://api.github.com/repos/atom-community/autocomplete-plus/issues/186/comments"},"review_comments":{"href":"https://api.github.com/repos/atom-community/autocomplete-plus/pulls/186/comments"},"review_comment":{"href":"https://api.github.com/repos/atom-community/autocomplete-plus/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/atom-community/autocomplete-plus/pulls/186/commits"},"statuses":{"href":"https://api.github.com/repos/atom-community/autocomplete-plus/statuses/2f7b102671b2dc670976673b9f9753d27dfa23d0"}}}}