1
0
forked from VimPlug/jedi

usages issues.

This commit is contained in:
Dave Halter
2014-09-25 00:14:43 +02:00
parent 9ecf3774a0
commit 59225ceaa3
4 changed files with 6 additions and 16 deletions

View File

@@ -478,8 +478,9 @@ class Script(object):
if isinstance(user_stmt, pr.ExprStmt):
for name in user_stmt.get_defined_names():
if name.start_pos <= self._pos <= name.end_pos \
and len(name.names) == 1:
return [name.names[0]]
and (not isinstance(name.parent, pr.Call)
or name.parent.next is None):
return [name]
defs = self._evaluator.goto(stmt, call_path)
definitions = follow_inexistent_imports(defs)
@@ -505,16 +506,6 @@ class Script(object):
# Without a definition for a name we cannot find references.
return []
# Once Script._goto works correct, we can probably remove this
# branch.
if isinstance(user_stmt, pr.ExprStmt):
c = user_stmt.expression_list()[0]
if not isinstance(c, unicode) and self._pos < c.start_pos:
# The lookup might be before `=`
definitions = [v.names[-1] for v in user_stmt.get_defined_names()
if unicode(v.names[-1]) ==
list(definitions)[0].get_code()]
if not isinstance(user_stmt, pr.Import):
# import case is looked at with add_import_name option
definitions = usages.usages_add_import_modules(self._evaluator,