forked from VimPlug/jedi-vim
Fix upstream #311
Use method `docstring()` instead of property `doc` Use property `description` instead of `get_code`
This commit is contained in:
@@ -131,7 +131,7 @@ def completions():
|
|||||||
abbr=PythonToVimStr(c.name),
|
abbr=PythonToVimStr(c.name),
|
||||||
# stuff directly behind the completion
|
# stuff directly behind the completion
|
||||||
menu=PythonToVimStr(c.description),
|
menu=PythonToVimStr(c.description),
|
||||||
info=PythonToVimStr(c.doc), # docstr
|
info=PythonToVimStr(c.docstring()), # docstr
|
||||||
icase=1, # case insensitive
|
icase=1, # case insensitive
|
||||||
dup=1 # allow duplicates (maybe later remove this)
|
dup=1 # allow duplicates (maybe later remove this)
|
||||||
)
|
)
|
||||||
@@ -219,8 +219,8 @@ def show_documentation():
|
|||||||
echo_highlight('No documentation found for that.')
|
echo_highlight('No documentation found for that.')
|
||||||
vim.command('return')
|
vim.command('return')
|
||||||
else:
|
else:
|
||||||
docs = ['Docstring for %s\n%s\n%s' % (d.desc_with_module, '=' * 40, d.doc)
|
docs = ['Docstring for %s\n%s\n%s' % (d.desc_with_module, '=' * 40, d.docstring())
|
||||||
if d.doc else '|No Docstring for %s|' % d for d in definitions]
|
if d.docstring() else '|No Docstring for %s|' % d for d in definitions]
|
||||||
text = ('\n' + '-' * 79 + '\n').join(docs)
|
text = ('\n' + '-' * 79 + '\n').join(docs)
|
||||||
vim.command('let l:doc = %s' % repr(PythonToVimStr(text)))
|
vim.command('let l:doc = %s' % repr(PythonToVimStr(text)))
|
||||||
vim.command('let l:doc_lines = %s' % len(text.split('\n')))
|
vim.command('let l:doc_lines = %s' % len(text.split('\n')))
|
||||||
@@ -268,7 +268,7 @@ def show_call_signatures(signatures=()):
|
|||||||
# TODO check if completion menu is above or below
|
# TODO check if completion menu is above or below
|
||||||
line = vim_eval("getline(%s)" % line_to_replace)
|
line = vim_eval("getline(%s)" % line_to_replace)
|
||||||
|
|
||||||
params = [p.get_code().replace('\n', '') for p in signature.params]
|
params = [p.description.replace('\n', '') for p in signature.params]
|
||||||
try:
|
try:
|
||||||
params[signature.index] = '*%s*' % params[signature.index]
|
params[signature.index] = '*%s*' % params[signature.index]
|
||||||
except (IndexError, TypeError):
|
except (IndexError, TypeError):
|
||||||
|
|||||||
Reference in New Issue
Block a user