{"action":"created","comment":{"url":"https://api.github.com/repos/scopatz/xonsh/pulls/comments/48676311","id":48676311,"diff_hunk":"@@ -200,19 +187,25 @@ def complete(self, prefix, line, begidx, endidx, ctx=None):\n             # anything goes.\n             rtn = self.cmd_complete(prefix)\n         elif cmd in self.bash_complete_funcs:\n-            rtn = set()\n-            for s in self.bash_complete(prefix, line, begidx, endidx):\n-                if os.path.isdir(s.rstrip()):\n-                    s = s.rstrip() + slash\n-                rtn.add(s)\n-            if len(rtn) == 0:\n-                rtn = self.path_complete(prefix, path_str_start, path_str_end)\n+            # bash completions\n+            rtn = self.bash_complete(prefix, line, begidx, endidx)\n+            rtn |= self.path_complete(prefix, path_str_start, path_str_end)\n+            return self._filter_repeats(rtn), lprefix\n         elif prefix.startswith('${') or prefix.startswith('@('):\n             # python mode explicitly\n-            rtn = set()\n+            return _python_mode_completions(self, prefix, prefixlow, startswither)\n         elif prefix.startswith('-'):\n             return sorted(self._man_completer.option_complete(prefix, cmd)), lprefix\n         elif cmd not in ctx:\n+            ltoks = line.split()\n+            if len(ltoks) > 2:\n+                if ltoks[0] == 'from' and ltoks[2] == 'import':\n+                    # complete thing inside a module\n+                    mod = __import__(ltoks[1])\n+                    out = sorted(i[0] for i in inspect.getmembers(mod) if i[0].startswith(prefix))","path":"xonsh/completer.py","position":63,"original_position":63,"commit_id":"80a76e895196b693c3031859f059fd0814bb38a6","original_commit_id":"80a76e895196b693c3031859f059fd0814bb38a6","user":{"login":"scopatz","id":320553,"avatar_url":"https://avatars.githubusercontent.com/u/320553?v=3","gravatar_id":"","url":"https://api.github.com/users/scopatz","html_url":"https://github.com/scopatz","followers_url":"https://api.github.com/users/scopatz/followers","following_url":"https://api.github.com/users/scopatz/following{/other_user}","gists_url":"https://api.github.com/users/scopatz/gists{/gist_id}","starred_url":"https://api.github.com/users/scopatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scopatz/subscriptions","organizations_url":"https://api.github.com/users/scopatz/orgs","repos_url":"https://api.github.com/users/scopatz/repos","events_url":"https://api.github.com/users/scopatz/events{/privacy}","received_events_url":"https://api.github.com/users/scopatz/received_events","type":"User","site_admin":false},"body":"* no need.","created_at":"2016-01-01T06:10:11Z","updated_at":"2016-01-01T06:10:11Z","html_url":"https://github.com/scopatz/xonsh/pull/597#discussion_r48676311","pull_request_url":"https://api.github.com/repos/scopatz/xonsh/pulls/597","_links":{"self":{"href":"https://api.github.com/repos/scopatz/xonsh/pulls/comments/48676311"},"html":{"href":"https://github.com/scopatz/xonsh/pull/597#discussion_r48676311"},"pull_request":{"href":"https://api.github.com/repos/scopatz/xonsh/pulls/597"}}},"pull_request":{"url":"https://api.github.com/repos/scopatz/xonsh/pulls/597","id":54884515,"html_url":"https://github.com/scopatz/xonsh/pull/597","diff_url":"https://github.com/scopatz/xonsh/pull/597.diff","patch_url":"https://github.com/scopatz/xonsh/pull/597.patch","issue_url":"https://api.github.com/repos/scopatz/xonsh/issues/597","number":597,"state":"open","locked":false,"title":"Completer Updates","user":{"login":"adqm","id":549404,"avatar_url":"https://avatars.githubusercontent.com/u/549404?v=3","gravatar_id":"","url":"https://api.github.com/users/adqm","html_url":"https://github.com/adqm","followers_url":"https://api.github.com/users/adqm/followers","following_url":"https://api.github.com/users/adqm/following{/other_user}","gists_url":"https://api.github.com/users/adqm/gists{/gist_id}","starred_url":"https://api.github.com/users/adqm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adqm/subscriptions","organizations_url":"https://api.github.com/users/adqm/orgs","repos_url":"https://api.github.com/users/adqm/repos","events_url":"https://api.github.com/users/adqm/events{/privacy}","received_events_url":"https://api.github.com/users/adqm/received_events","type":"User","site_admin":false},"body":"A few updates for the completer that should fix some of the issues that are lying around:\r\n* slight efficiency improvement for the known commands cache\r\n* added code to avoid repeated completions (which I think should fix #575)\r\n* implementation of `from module import <tab>` (#590)\r\n","created_at":"2015-12-31T23:56:14Z","updated_at":"2016-01-01T06:10:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a5b9529383ac797ae31ab4f47ab5495af1872b0f","assignee":null,"milestone":{"url":"https://api.github.com/repos/scopatz/xonsh/milestones/2","html_url":"https://github.com/scopatz/xonsh/milestones/v0.3","labels_url":"https://api.github.com/repos/scopatz/xonsh/milestones/2/labels","id":1302567,"number":2,"title":"v0.3","description":"","creator":{"login":"scopatz","id":320553,"avatar_url":"https://avatars.githubusercontent.com/u/320553?v=3","gravatar_id":"","url":"https://api.github.com/users/scopatz","html_url":"https://github.com/scopatz","followers_url":"https://api.github.com/users/scopatz/followers","following_url":"https://api.github.com/users/scopatz/following{/other_user}","gists_url":"https://api.github.com/users/scopatz/gists{/gist_id}","starred_url":"https://api.github.com/users/scopatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scopatz/subscriptions","organizations_url":"https://api.github.com/users/scopatz/orgs","repos_url":"https://api.github.com/users/scopatz/repos","events_url":"https://api.github.com/users/scopatz/events{/privacy}","received_events_url":"https://api.github.com/users/scopatz/received_events","type":"User","site_admin":false},"open_issues":103,"closed_issues":135,"state":"open","created_at":"2015-09-12T18:28:59Z","updated_at":"2016-01-01T05:59:07Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/scopatz/xonsh/pulls/597/commits","review_comments_url":"https://api.github.com/repos/scopatz/xonsh/pulls/597/comments","review_comment_url":"https://api.github.com/repos/scopatz/xonsh/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scopatz/xonsh/issues/597/comments","statuses_url":"https://api.github.com/repos/scopatz/xonsh/statuses/80a76e895196b693c3031859f059fd0814bb38a6","head":{"label":"adqm:completer","ref":"completer","sha":"80a76e895196b693c3031859f059fd0814bb38a6","user":{"login":"adqm","id":549404,"avatar_url":"https://avatars.githubusercontent.com/u/549404?v=3","gravatar_id":"","url":"https://api.github.com/users/adqm","html_url":"https://github.com/adqm","followers_url":"https://api.github.com/users/adqm/followers","following_url":"https://api.github.com/users/adqm/following{/other_user}","gists_url":"https://api.github.com/users/adqm/gists{/gist_id}","starred_url":"https://api.github.com/users/adqm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adqm/subscriptions","organizations_url":"https://api.github.com/users/adqm/orgs","repos_url":"https://api.github.com/users/adqm/repos","events_url":"https://api.github.com/users/adqm/events{/privacy}","received_events_url":"https://api.github.com/users/adqm/received_events","type":"User","site_admin":false},"repo":{"id":32187841,"name":"xonsh","full_name":"adqm/xonsh","owner":{"login":"adqm","id":549404,"avatar_url":"https://avatars.githubusercontent.com/u/549404?v=3","gravatar_id":"","url":"https://api.github.com/users/adqm","html_url":"https://github.com/adqm","followers_url":"https://api.github.com/users/adqm/followers","following_url":"https://api.github.com/users/adqm/following{/other_user}","gists_url":"https://api.github.com/users/adqm/gists{/gist_id}","starred_url":"https://api.github.com/users/adqm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adqm/subscriptions","organizations_url":"https://api.github.com/users/adqm/orgs","repos_url":"https://api.github.com/users/adqm/repos","events_url":"https://api.github.com/users/adqm/events{/privacy}","received_events_url":"https://api.github.com/users/adqm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adqm/xonsh","description":"xonsh is a Python-ish, BASHwards-compatible shell.","fork":true,"url":"https://api.github.com/repos/adqm/xonsh","forks_url":"https://api.github.com/repos/adqm/xonsh/forks","keys_url":"https://api.github.com/repos/adqm/xonsh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adqm/xonsh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adqm/xonsh/teams","hooks_url":"https://api.github.com/repos/adqm/xonsh/hooks","issue_events_url":"https://api.github.com/repos/adqm/xonsh/issues/events{/number}","events_url":"https://api.github.com/repos/adqm/xonsh/events","assignees_url":"https://api.github.com/repos/adqm/xonsh/assignees{/user}","branches_url":"https://api.github.com/repos/adqm/xonsh/branches{/branch}","tags_url":"https://api.github.com/repos/adqm/xonsh/tags","blobs_url":"https://api.github.com/repos/adqm/xonsh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adqm/xonsh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adqm/xonsh/git/refs{/sha}","trees_url":"https://api.github.com/repos/adqm/xonsh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adqm/xonsh/statuses/{sha}","languages_url":"https://api.github.com/repos/adqm/xonsh/languages","stargazers_url":"https://api.github.com/repos/adqm/xonsh/stargazers","contributors_url":"https://api.github.com/repos/adqm/xonsh/contributors","subscribers_url":"https://api.github.com/repos/adqm/xonsh/subscribers","subscription_url":"https://api.github.com/repos/adqm/xonsh/subscription","commits_url":"https://api.github.com/repos/adqm/xonsh/commits{/sha}","git_commits_url":"https://api.github.com/repos/adqm/xonsh/git/commits{/sha}","comments_url":"https://api.github.com/repos/adqm/xonsh/comments{/number}","issue_comment_url":"https://api.github.com/repos/adqm/xonsh/issues/comments{/number}","contents_url":"https://api.github.com/repos/adqm/xonsh/contents/{+path}","compare_url":"https://api.github.com/repos/adqm/xonsh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adqm/xonsh/merges","archive_url":"https://api.github.com/repos/adqm/xonsh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adqm/xonsh/downloads","issues_url":"https://api.github.com/repos/adqm/xonsh/issues{/number}","pulls_url":"https://api.github.com/repos/adqm/xonsh/pulls{/number}","milestones_url":"https://api.github.com/repos/adqm/xonsh/milestones{/number}","notifications_url":"https://api.github.com/repos/adqm/xonsh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adqm/xonsh/labels{/name}","releases_url":"https://api.github.com/repos/adqm/xonsh/releases{/id}","created_at":"2015-03-14T00:10:49Z","updated_at":"2015-05-07T12:12:54Z","pushed_at":"2015-12-31T23:48:07Z","git_url":"git://github.com/adqm/xonsh.git","ssh_url":"git@github.com:adqm/xonsh.git","clone_url":"https://github.com/adqm/xonsh.git","svn_url":"https://github.com/adqm/xonsh","homepage":"http://xonsh.org","size":3186,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"scopatz:master","ref":"master","sha":"1c6dbe6b584b6aeb85cd01f35c0595c65422365b","user":{"login":"scopatz","id":320553,"avatar_url":"https://avatars.githubusercontent.com/u/320553?v=3","gravatar_id":"","url":"https://api.github.com/users/scopatz","html_url":"https://github.com/scopatz","followers_url":"https://api.github.com/users/scopatz/followers","following_url":"https://api.github.com/users/scopatz/following{/other_user}","gists_url":"https://api.github.com/users/scopatz/gists{/gist_id}","starred_url":"https://api.github.com/users/scopatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scopatz/subscriptions","organizations_url":"https://api.github.com/users/scopatz/orgs","repos_url":"https://api.github.com/users/scopatz/repos","events_url":"https://api.github.com/users/scopatz/events{/privacy}","received_events_url":"https://api.github.com/users/scopatz/received_events","type":"User","site_admin":false},"repo":{"id":29620400,"name":"xonsh","full_name":"scopatz/xonsh","owner":{"login":"scopatz","id":320553,"avatar_url":"https://avatars.githubusercontent.com/u/320553?v=3","gravatar_id":"","url":"https://api.github.com/users/scopatz","html_url":"https://github.com/scopatz","followers_url":"https://api.github.com/users/scopatz/followers","following_url":"https://api.github.com/users/scopatz/following{/other_user}","gists_url":"https://api.github.com/users/scopatz/gists{/gist_id}","starred_url":"https://api.github.com/users/scopatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scopatz/subscriptions","organizations_url":"https://api.github.com/users/scopatz/orgs","repos_url":"https://api.github.com/users/scopatz/repos","events_url":"https://api.github.com/users/scopatz/events{/privacy}","received_events_url":"https://api.github.com/users/scopatz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/scopatz/xonsh","description":"xonsh is a Python-ish, BASHwards-facing shell.","fork":false,"url":"https://api.github.com/repos/scopatz/xonsh","forks_url":"https://api.github.com/repos/scopatz/xonsh/forks","keys_url":"https://api.github.com/repos/scopatz/xonsh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scopatz/xonsh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scopatz/xonsh/teams","hooks_url":"https://api.github.com/repos/scopatz/xonsh/hooks","issue_events_url":"https://api.github.com/repos/scopatz/xonsh/issues/events{/number}","events_url":"https://api.github.com/repos/scopatz/xonsh/events","assignees_url":"https://api.github.com/repos/scopatz/xonsh/assignees{/user}","branches_url":"https://api.github.com/repos/scopatz/xonsh/branches{/branch}","tags_url":"https://api.github.com/repos/scopatz/xonsh/tags","blobs_url":"https://api.github.com/repos/scopatz/xonsh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scopatz/xonsh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scopatz/xonsh/git/refs{/sha}","trees_url":"https://api.github.com/repos/scopatz/xonsh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scopatz/xonsh/statuses/{sha}","languages_url":"https://api.github.com/repos/scopatz/xonsh/languages","stargazers_url":"https://api.github.com/repos/scopatz/xonsh/stargazers","contributors_url":"https://api.github.com/repos/scopatz/xonsh/contributors","subscribers_url":"https://api.github.com/repos/scopatz/xonsh/subscribers","subscription_url":"https://api.github.com/repos/scopatz/xonsh/subscription","commits_url":"https://api.github.com/repos/scopatz/xonsh/commits{/sha}","git_commits_url":"https://api.github.com/repos/scopatz/xonsh/git/commits{/sha}","comments_url":"https://api.github.com/repos/scopatz/xonsh/comments{/number}","issue_comment_url":"https://api.github.com/repos/scopatz/xonsh/issues/comments{/number}","contents_url":"https://api.github.com/repos/scopatz/xonsh/contents/{+path}","compare_url":"https://api.github.com/repos/scopatz/xonsh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scopatz/xonsh/merges","archive_url":"https://api.github.com/repos/scopatz/xonsh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scopatz/xonsh/downloads","issues_url":"https://api.github.com/repos/scopatz/xonsh/issues{/number}","pulls_url":"https://api.github.com/repos/scopatz/xonsh/pulls{/number}","milestones_url":"https://api.github.com/repos/scopatz/xonsh/milestones{/number}","notifications_url":"https://api.github.com/repos/scopatz/xonsh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scopatz/xonsh/labels{/name}","releases_url":"https://api.github.com/repos/scopatz/xonsh/releases{/id}","created_at":"2015-01-21T22:05:27Z","updated_at":"2015-12-31T21:39:29Z","pushed_at":"2016-01-01T05:57:40Z","git_url":"git://github.com/scopatz/xonsh.git","ssh_url":"git@github.com:scopatz/xonsh.git","clone_url":"https://github.com/scopatz/xonsh.git","svn_url":"https://github.com/scopatz/xonsh","homepage":"http://xonsh.org","size":3981,"stargazers_count":629,"watchers_count":629,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":81,"mirror_url":null,"open_issues_count":114,"forks":81,"open_issues":114,"watchers":629,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scopatz/xonsh/pulls/597"},"html":{"href":"https://github.com/scopatz/xonsh/pull/597"},"issue":{"href":"https://api.github.com/repos/scopatz/xonsh/issues/597"},"comments":{"href":"https://api.github.com/repos/scopatz/xonsh/issues/597/comments"},"review_comments":{"href":"https://api.github.com/repos/scopatz/xonsh/pulls/597/comments"},"review_comment":{"href":"https://api.github.com/repos/scopatz/xonsh/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scopatz/xonsh/pulls/597/commits"},"statuses":{"href":"https://api.github.com/repos/scopatz/xonsh/statuses/80a76e895196b693c3031859f059fd0814bb38a6"}}}}