forked from VimPlug/jedi
fix Param calling in API
This commit is contained in:
@@ -491,7 +491,7 @@ class Script(object):
|
|||||||
origins = cache.cache_call_signatures(_callable, user_stmt)
|
origins = cache.cache_call_signatures(_callable, user_stmt)
|
||||||
debug.speed('func_call followed')
|
debug.speed('func_call followed')
|
||||||
|
|
||||||
return [classes.CallDef(o, index, call) for o in origins
|
return [classes.CallDef(self._evaluator, o, index, call) for o in origins
|
||||||
if o.isinstance(er.Function, er.Instance, er.Class)
|
if o.isinstance(er.Function, er.Instance, er.Class)
|
||||||
or isinstance(o, compiled.CompiledObject) and o.type() != 'module']
|
or isinstance(o, compiled.CompiledObject) and o.type() != 'module']
|
||||||
|
|
||||||
|
|||||||
@@ -548,7 +548,8 @@ class CallDef(object):
|
|||||||
It knows what functions you are currently in. e.g. `isinstance(` would
|
It knows what functions you are currently in. e.g. `isinstance(` would
|
||||||
return the `isinstance` function. without `(` it would return nothing.
|
return the `isinstance` function. without `(` it would return nothing.
|
||||||
"""
|
"""
|
||||||
def __init__(self, executable, index, call):
|
def __init__(self, evaluator, executable, index, call):
|
||||||
|
self._evaluator = evaluator
|
||||||
self._executable = executable
|
self._executable = executable
|
||||||
self.index = index
|
self.index = index
|
||||||
self._call = call
|
self._call = call
|
||||||
@@ -558,7 +559,8 @@ class CallDef(object):
|
|||||||
if self._executable.isinstance(er.Function):
|
if self._executable.isinstance(er.Function):
|
||||||
if isinstance(self._executable, er.InstanceElement):
|
if isinstance(self._executable, er.InstanceElement):
|
||||||
params = self._executable.params[1:]
|
params = self._executable.params[1:]
|
||||||
return self._executable.params
|
else:
|
||||||
|
params = self._executable.params
|
||||||
elif self._executable.isinstance(er.compiled.CompiledObject):
|
elif self._executable.isinstance(er.compiled.CompiledObject):
|
||||||
params = self._executable.params
|
params = self._executable.params
|
||||||
else:
|
else:
|
||||||
@@ -567,7 +569,7 @@ class CallDef(object):
|
|||||||
params = sub.params[1:] # ignore self
|
params = sub.params[1:] # ignore self
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return []
|
return []
|
||||||
return [Param(p) for p in params]
|
return [Param(self._evaluator, p) for p in params]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def bracket_start(self):
|
def bracket_start(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user