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]
|
c = user_stmt.expression_list()[0]
|
||||||
if not isinstance(c, unicode) and self._pos < c.start_pos:
|
if not isinstance(c, unicode) and self._pos < c.start_pos:
|
||||||
# The lookup might be before `=`
|
# 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]) ==
|
if unicode(v.names[-1]) ==
|
||||||
list(definitions)[0].get_code()]
|
list(definitions)[0].get_code()]
|
||||||
|
|
||||||
|
|||||||
@@ -92,8 +92,9 @@ def usages_add_import_modules(evaluator, definitions):
|
|||||||
""" Adds the modules of the imports """
|
""" Adds the modules of the imports """
|
||||||
new = set()
|
new = set()
|
||||||
for d in definitions:
|
for d in definitions:
|
||||||
if isinstance(d.parent, pr.Import):
|
imp_or_stmt = d.get_definition()
|
||||||
s = imports.ImportWrapper(evaluator, d.parent, nested_resolve=True)
|
if isinstance(imp_or_stmt, pr.Import):
|
||||||
|
s = imports.ImportWrapper(evaluator, imp_or_stmt, nested_resolve=True)
|
||||||
with common.ignored(IndexError):
|
with common.ignored(IndexError):
|
||||||
new.add(s.follow(is_goto=True)[0])
|
new.add(s.follow(is_goto=True)[0])
|
||||||
return set(definitions) | new
|
return set(definitions) | new
|
||||||
|
|||||||
Reference in New Issue
Block a user