forked from VimPlug/jedi
Refactoring: add Function.doc
This commit is contained in:
@@ -74,14 +74,9 @@ class Completion(object):
|
|||||||
def doc(self):
|
def doc(self):
|
||||||
""" Return a document string for this completion object. """
|
""" Return a document string for this completion object. """
|
||||||
try:
|
try:
|
||||||
parent = self.name.parent()
|
return self.name.parent().doc
|
||||||
try:
|
|
||||||
return '%s\n\n%s' % (parent.get_call_signature(),
|
|
||||||
parent.docstr)
|
|
||||||
except AttributeError:
|
|
||||||
return str(parent.docstr)
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return ''
|
return self.raw_doc
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def raw_doc(self):
|
def raw_doc(self):
|
||||||
|
|||||||
@@ -410,6 +410,11 @@ class Function(Scope):
|
|||||||
lines[-1] += ')'
|
lines[-1] += ')'
|
||||||
return '\n'.join(lines)
|
return '\n'.join(lines)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def doc(self):
|
||||||
|
""" Return a document string including call signature. """
|
||||||
|
return '%s\n\n%s' % (self.get_call_signature(), self.docstr)
|
||||||
|
|
||||||
|
|
||||||
class Flow(Scope):
|
class Flow(Scope):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user