forked from VimPlug/jedi
Fix signature to_string
This commit is contained in:
+11
-4
@@ -184,12 +184,19 @@ class ParamName(ParamNameInterface, AbstractTreeName):
|
||||
return Parameter.VAR_KEYWORD
|
||||
|
||||
parent = tree_param.parent
|
||||
param_appeared = False
|
||||
for p in parent.children:
|
||||
if p.type == 'param':
|
||||
if p.star_count:
|
||||
if param_appeared:
|
||||
if p == '/':
|
||||
return Parameter.POSITIONAL_ONLY
|
||||
else:
|
||||
if p == '*':
|
||||
return Parameter.KEYWORD_ONLY
|
||||
if p == tree_param:
|
||||
break
|
||||
if p.type == 'param':
|
||||
if p.star_count:
|
||||
return Parameter.KEYWORD_ONLY
|
||||
if p == tree_param:
|
||||
param_appeared = True
|
||||
return Parameter.POSITIONAL_OR_KEYWORD
|
||||
|
||||
def to_string(self):
|
||||
|
||||
@@ -25,8 +25,10 @@ class AbstractSignature(object):
|
||||
yield '/'
|
||||
is_positional = False
|
||||
|
||||
if kind == Parameter.KEYWORD_ONLY and not is_kw_only:
|
||||
yield '*,'
|
||||
if kind == Parameter.VAR_POSITIONAL:
|
||||
is_kw_only = True
|
||||
elif kind == Parameter.KEYWORD_ONLY and not is_kw_only:
|
||||
yield '*'
|
||||
is_kw_only = True
|
||||
|
||||
yield n.to_string()
|
||||
|
||||
Reference in New Issue
Block a user