forked from VimPlug/jedi
fix issues introduced with defined_names.
This commit is contained in:
@@ -27,6 +27,12 @@ def defined_names(evaluator, scope):
|
|||||||
:type scope: Scope
|
:type scope: Scope
|
||||||
:rtype: list of Definition
|
:rtype: list of Definition
|
||||||
"""
|
"""
|
||||||
|
# Calling get_names_of_scope doesn't make sense always. It might include
|
||||||
|
# star imports or inherited stuff. Wanted?
|
||||||
|
# TODO discuss!
|
||||||
|
if isinstance(scope, pr.Module):
|
||||||
|
pair = scope, scope.get_defined_names()
|
||||||
|
else:
|
||||||
pair = next(get_names_of_scope(evaluator, scope, star_search=False,
|
pair = next(get_names_of_scope(evaluator, scope, star_search=False,
|
||||||
include_builtin=False), None)
|
include_builtin=False), None)
|
||||||
names = pair[1] if pair else []
|
names = pair[1] if pair else []
|
||||||
|
|||||||
Reference in New Issue
Block a user