1
0
forked from VimPlug/jedi

Merge remote-tracking branch 'origin/master' into typeshed

This commit is contained in:
Dave Halter
2018-12-15 18:20:51 +01:00
6 changed files with 46 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
import re
import textwrap
from inspect import cleandoc
@@ -158,6 +159,7 @@ def get_call_signature(funcdef, width=72, call_string=None):
p = '(' + ''.join(param.get_code() for param in funcdef.get_params()).strip() + ')'
else:
p = funcdef.children[2].get_code()
p = re.sub(r'\s+', ' ', p)
if funcdef.annotation:
rtype = " ->" + funcdef.annotation.get_code()
else:
@@ -187,6 +189,8 @@ def get_doc_with_call_signature(scope_node):
doc = clean_scope_docstring(scope_node)
if call_signature is None:
return doc
if not doc:
return call_signature
return '%s\n\n%s' % (call_signature, doc)