forked from VimPlug/jedi
fix the named param issue in the autocompletion
This commit is contained in:
@@ -163,7 +163,8 @@ class Script(object):
|
||||
# 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 p._definition.stars == 0: # no *args/**kwargs
|
||||
completions.append((p._definition.get_name(), p))
|
||||
|
||||
if not path and not isinstance(user_stmt, pr.Import):
|
||||
# add keywords
|
||||
|
||||
@@ -567,7 +567,9 @@ class Definition(use_metaclass(CachedMetaClass, BaseDefinition)):
|
||||
if isinstance(d, pr.Param):
|
||||
try:
|
||||
return unicode(d.expression_list()[0].name)
|
||||
except IndexError:
|
||||
except (IndexError, AttributeError):
|
||||
# IndexError for syntax error params
|
||||
# AttributeError for *args/**kwargs
|
||||
pass
|
||||
return None
|
||||
elif isinstance(d, iterable.Generator):
|
||||
|
||||
Reference in New Issue
Block a user