1
0
forked from VimPlug/jedi

Separate getting docstrings and getting signatures for names, see discussion #1466

This commit is contained in:
Dave Halter
2020-01-01 22:58:52 +01:00
parent bb3a81c578
commit 0a53ce5136
6 changed files with 56 additions and 40 deletions

View File

@@ -241,7 +241,18 @@ class BaseDefinition(object):
"""
if isinstance(self._name, ImportName) and fast:
return ''
return self._name.py__doc__(include_signatures=not raw)
doc = self._name.py__doc__()
if raw:
return doc
signature_text = '\n'.join(
signature.to_string()
for signature in self._name.get_signatures()
)
if signature_text and doc:
return signature_text + '\n\n' + doc
else:
return signature_text + doc
@property
def description(self):