forked from VimPlug/jedi
Fix remaining usage issues.
This commit is contained in:
@@ -504,7 +504,7 @@ class Script(object):
|
||||
c = user_stmt.expression_list()[0]
|
||||
if not isinstance(c, unicode) and self._pos < c.start_pos:
|
||||
# The lookup might be before `=`
|
||||
definitions = [v for v in user_stmt.get_defined_names()
|
||||
definitions = [v.names[-1] for v in user_stmt.get_defined_names()
|
||||
if unicode(v.names[-1]) ==
|
||||
list(definitions)[0].get_code()]
|
||||
|
||||
|
||||
@@ -92,8 +92,9 @@ def usages_add_import_modules(evaluator, definitions):
|
||||
""" Adds the modules of the imports """
|
||||
new = set()
|
||||
for d in definitions:
|
||||
if isinstance(d.parent, pr.Import):
|
||||
s = imports.ImportWrapper(evaluator, d.parent, nested_resolve=True)
|
||||
imp_or_stmt = d.get_definition()
|
||||
if isinstance(imp_or_stmt, pr.Import):
|
||||
s = imports.ImportWrapper(evaluator, imp_or_stmt, nested_resolve=True)
|
||||
with common.ignored(IndexError):
|
||||
new.add(s.follow(is_goto=True)[0])
|
||||
return set(definitions) | new
|
||||
|
||||
Reference in New Issue
Block a user