1
0
forked from VimPlug/jedi

os.path handling.

This commit is contained in:
Dave Halter
2014-12-11 01:49:59 +01:00
parent ef0958a43c
commit 48d2e99e55
3 changed files with 23 additions and 20 deletions

View File

@@ -136,7 +136,7 @@ class Script(object):
names, level, only_modules = helpers.check_error_statements(module, self._pos)
completions = []
#print(importer.completion_names(self._evaluator, True))
if names:
if names is not None:
imp_names = [n for n in names if n.end_pos < self._pos]
i = imports.get_importer(self._evaluator, imp_names, module, level)
c_names = i.completion_names(self._evaluator, only_modules)
@@ -155,7 +155,7 @@ class Script(object):
imp = imports.ImportWrapper(self._evaluator, name)
completions += [(n, module) for n in imp.completion_names()]
if not names and not isinstance(user_stmt, pr.Import):
if names is None and not isinstance(user_stmt, pr.Import):
if not path and not dot:
# add keywords
completions += ((k, b) for k in keywords.keyword_names(all=True))

View File

@@ -39,7 +39,7 @@ def check_error_statements(module, pos):
if error_statement.first_type in ('import_from', 'import_name') \
and error_statement.first_pos < pos <= error_statement.next_start_pos:
return importer_from_error_statement(error_statement, pos)
return [], 0, False
return None, 0, False
def importer_from_error_statement(error_statement, pos):