forked from VimPlug/jedi
fix Definition.name API for params
This commit is contained in:
@@ -138,7 +138,10 @@ class Script(object):
|
||||
for call_def in self.call_signatures():
|
||||
if not isinstance(call_def.module, compiled.CompiledObject):
|
||||
for p in call_def.params:
|
||||
completions.append((p.get_name(), p))
|
||||
# Allow access on _definition here, because it's a
|
||||
# public API and we don't want to make the internal
|
||||
# Name object public.
|
||||
completions.append((p._definition.get_name(), p))
|
||||
|
||||
if not path and not isinstance(user_stmt, pr.Import):
|
||||
# add keywords
|
||||
|
||||
@@ -451,11 +451,12 @@ class Definition(BaseDefinition):
|
||||
return None
|
||||
elif isinstance(d, pr.Statement):
|
||||
try:
|
||||
name = d.assignment_details[0][1].values[0][0].name.names[-1]
|
||||
expression_list = d.assignment_details[0][0]
|
||||
name = expression_list[0].name.names[-1]
|
||||
except IndexError:
|
||||
if isinstance(d, pr.Param):
|
||||
try:
|
||||
name = d.expression_list()[0].name.names[-1]
|
||||
return unicode(d.expression_list()[0].name)
|
||||
except IndexError:
|
||||
pass
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user