1
0
forked from VimPlug/jedi

last commit was partially wrong

This commit is contained in:
David Halter
2012-11-20 17:17:16 +01:00
parent 3b2367a47a
commit cfaff62d47

View File

@@ -1015,16 +1015,17 @@ def get_scopes_for_name(scope, name_str, position=None, search_global=False,
# execute first.
if isinstance(r, parsing.Param):
func = r.parent()
if not r.is_generated:
# Instances are typically faked, if the instance is
# not called from outside. Here we check it for
# __init__ functions and return.
if isinstance(func, InstanceElement) \
and func.instance.is_generated \
and str(func.name) == '__init__' \
and r.position_nr > 0: # 0 would be self
r = func.var.params[r.position_nr]
# Instances are typically faked, if the instance is not
# called from outside. Here we check it for __init__
# functions and return.
if isinstance(func, InstanceElement) \
and func.instance.is_generated \
and hasattr(func, 'name') \
and str(func.name) == '__init__' \
and r.position_nr > 0: # 0 would be self
r = func.var.params[r.position_nr]
if not r.is_generated:
res_new += dynamic.search_params(r)
if not r.assignment_details:
# this means that there are no default params,