1
0
forked from VimPlug/jedi

use builtin repl completion after all, but written by us not the std lib module, which doesn't seem to work really, #280

This commit is contained in:
David Halter
2013-08-15 12:47:10 +04:30
parent 306dbf12e4
commit 9a3ea38b1c
4 changed files with 47 additions and 12 deletions

View File

@@ -91,7 +91,7 @@ class Script(object):
path = self._module.get_path_until_cursor()
if re.search('^\.|\.\.$', path):
return []
path, dot, like = self._get_completion_parts(path)
path, dot, like = self._get_completion_parts()
completion_line = self._module.get_line(self.pos[0])[:self.pos[1]]
try:
@@ -506,11 +506,12 @@ class Script(object):
kill_count=kill_count, direct_resolve=True)
return i, cur_name_part
def _get_completion_parts(self, path):
def _get_completion_parts(self):
"""
Returns the parts for the completion
:return: tuple - (path, dot, like)
"""
path = self._module.get_path_until_cursor()
match = re.match(r'^(.*?)(\.|)(\w?[\w\d]*)$', path, flags=re.S)
return match.groups()