forked from VimPlug/jedi
Fix compiled docstrings for stubs
This commit is contained in:
@@ -167,19 +167,23 @@ def get_call_signature(funcdef, width=72, call_string=None):
|
||||
return '\n'.join(textwrap.wrap(code, width))
|
||||
|
||||
|
||||
def get_call_signature_for_any(any_node):
|
||||
call_signature = None
|
||||
if any_node.type == 'classdef':
|
||||
for funcdef in any_node.iter_funcdefs():
|
||||
if funcdef.name.value == '__init__':
|
||||
call_signature = \
|
||||
get_call_signature(funcdef, call_string=any_node.name.value)
|
||||
elif any_node.type in ('funcdef', 'lambdef'):
|
||||
call_signature = get_call_signature(any_node)
|
||||
return call_signature
|
||||
|
||||
|
||||
def get_doc_with_call_signature(scope_node):
|
||||
"""
|
||||
Return a document string including call signature.
|
||||
"""
|
||||
call_signature = None
|
||||
if scope_node.type == 'classdef':
|
||||
for funcdef in scope_node.iter_funcdefs():
|
||||
if funcdef.name.value == '__init__':
|
||||
call_signature = \
|
||||
get_call_signature(funcdef, call_string=scope_node.name.value)
|
||||
elif scope_node.type in ('funcdef', 'lambdef'):
|
||||
call_signature = get_call_signature(scope_node)
|
||||
|
||||
call_signature = get_call_signature_for_any(scope_node)
|
||||
doc = clean_scope_docstring(scope_node)
|
||||
if call_signature is None:
|
||||
return doc
|
||||
|
||||
Reference in New Issue
Block a user