mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-08 19:44:52 +08:00
Fix complete() deprecation.
This commit is contained in:
@@ -92,7 +92,7 @@ if 1:
|
|||||||
else:
|
else:
|
||||||
text = 'import %s' % argl
|
text = 'import %s' % argl
|
||||||
script=jedi.Script(text, 1, len(text), '')
|
script=jedi.Script(text, 1, len(text), '')
|
||||||
comps = [ '%s%s' % (argl, c.complete) for c in script.complete()]
|
comps = ['%s%s' % (argl, c.complete) for c in script.completions()]
|
||||||
vim.command("let comps = '%s'" % '\n'.join(comps))
|
vim.command("let comps = '%s'" % '\n'.join(comps))
|
||||||
EOF
|
EOF
|
||||||
return comps
|
return comps
|
||||||
|
|||||||
@@ -71,13 +71,14 @@ def complete():
|
|||||||
column += len(base)
|
column += len(base)
|
||||||
try:
|
try:
|
||||||
script = get_script(source=source, column=column)
|
script = get_script(source=source, column=column)
|
||||||
completions = script.complete()
|
completions = script.completions()
|
||||||
call_def = script.get_in_function_call()
|
sig = script.call_signatures()
|
||||||
|
call_def =sig[0] if sig else None
|
||||||
|
|
||||||
out = []
|
out = []
|
||||||
for c in completions:
|
for c in completions:
|
||||||
d = dict(word=PythonToVimStr(c.word[:len(base)] + c.complete),
|
d = dict(word=PythonToVimStr(c.name[:len(base)] + c.complete),
|
||||||
abbr=PythonToVimStr(c.word),
|
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.doc), # docstr
|
||||||
|
|||||||
Reference in New Issue
Block a user