1
0
forked from VimPlug/jedi

fix completion on int literals, fixes #327

This commit is contained in:
Dave Halter
2014-04-07 13:04:45 +02:00
parent 6ebc40792a
commit 99beac1c2b
2 changed files with 27 additions and 1 deletions

View File

@@ -130,9 +130,24 @@ class Script(object):
return ((k, bs) for k in keywords.keyword_names('import'))
return self._simple_complete(path, like)
def completion_possible(path):
"""
The completion logic is kind of complicated, because we strip the
last word part. To ignore certain strange patterns with dots, just
use regex.
"""
dots = re.search('^\.|([\d.]+)\.$', path)
if dots:
literal = dots.group(1)
print(literal)
if re.search('\d\.|\.{3}', literal or ''):
return True
return False
return True
debug.speed('completions start')
path = self._user_context.get_path_until_cursor()
if re.search('^\.|\.\.$', path):
if not completion_possible(path):
return []
path, dot, like = helpers.completion_parts(path)