From cf3182e549c8cab2f317b00639ebe3d3a35969cd Mon Sep 17 00:00:00 2001 From: heavenshell Date: Sat, 1 Jun 2013 00:27:14 +0900 Subject: [PATCH 1/7] Fix complete() deprecation. --- plugin/jedi.vim | 2 +- plugin/jedi_vim.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugin/jedi.vim b/plugin/jedi.vim index 9e0b013..640b2f3 100644 --- a/plugin/jedi.vim +++ b/plugin/jedi.vim @@ -92,7 +92,7 @@ if 1: else: text = 'import %s' % argl 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)) EOF return comps diff --git a/plugin/jedi_vim.py b/plugin/jedi_vim.py index a355cdb..3215771 100644 --- a/plugin/jedi_vim.py +++ b/plugin/jedi_vim.py @@ -71,13 +71,14 @@ def complete(): column += len(base) try: script = get_script(source=source, column=column) - completions = script.complete() - call_def = script.get_in_function_call() + completions = script.completions() + sig = script.call_signatures() + call_def =sig[0] if sig else None out = [] for c in completions: - d = dict(word=PythonToVimStr(c.word[:len(base)] + c.complete), - abbr=PythonToVimStr(c.word), + d = dict(word=PythonToVimStr(c.name[:len(base)] + c.complete), + abbr=PythonToVimStr(c.name), # stuff directly behind the completion menu=PythonToVimStr(c.description), info=PythonToVimStr(c.doc), # docstr From efb1997218cfd64df147e4dcc7756c5b4c650628 Mon Sep 17 00:00:00 2001 From: heavenshell Date: Sat, 1 Jun 2013 00:37:15 +0900 Subject: [PATCH 2/7] Fix show_pydoc() get_definition() deprecation. --- plugin/jedi_vim.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/jedi_vim.py b/plugin/jedi_vim.py index 3215771..b25f52b 100644 --- a/plugin/jedi_vim.py +++ b/plugin/jedi_vim.py @@ -160,7 +160,7 @@ def goto(is_definition=False, is_related_name=False, no_output=False): def show_pydoc(): script = get_script() try: - definitions = script.get_definition() + definitions = script.goto_definitions() except jedi.NotFoundError: definitions = [] except Exception: From e4a2a0f30e780b6b7e87c8563faa6bc72f2b31bd Mon Sep 17 00:00:00 2001 From: heavenshell Date: Sat, 1 Jun 2013 00:41:04 +0900 Subject: [PATCH 3/7] Fix get_definition() deprecation. --- plugin/jedi_vim.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/jedi_vim.py b/plugin/jedi_vim.py index b25f52b..30c2a37 100644 --- a/plugin/jedi_vim.py +++ b/plugin/jedi_vim.py @@ -107,7 +107,7 @@ def goto(is_definition=False, is_related_name=False, no_output=False): if is_related_name: definitions = script.related_names() elif is_definition: - definitions = script.get_definition() + definitions = script.goto_definitions() else: definitions = script.goto() except jedi.NotFoundError: @@ -150,7 +150,7 @@ def goto(is_definition=False, is_related_name=False, no_output=False): PythonToVimStr('Builtin ' + d.description))) else: lst.append(dict(filename=PythonToVimStr(d.module_path), - lnum=d.line_nr, col=d.column + 1, + lnum=d.line, col=d.column + 1, text=PythonToVimStr(d.description))) vim.eval('setqflist(%s)' % repr(lst)) vim.eval('jedi#add_goto_window()') From 355203cab068a3a48041a229aa31c5dd73be7f3a Mon Sep 17 00:00:00 2001 From: heavenshell Date: Sat, 1 Jun 2013 00:47:11 +0900 Subject: [PATCH 4/7] Fix goto() deprecation. --- plugin/jedi_vim.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/jedi_vim.py b/plugin/jedi_vim.py index 30c2a37..18e5b35 100644 --- a/plugin/jedi_vim.py +++ b/plugin/jedi_vim.py @@ -109,7 +109,7 @@ def goto(is_definition=False, is_related_name=False, no_output=False): elif is_definition: definitions = script.goto_definitions() else: - definitions = script.goto() + definitions = script.goto_assignments() except jedi.NotFoundError: echo_highlight( "Cannot follow nothing. Put your cursor on a valid name.") @@ -139,7 +139,7 @@ def goto(is_definition=False, is_related_name=False, no_output=False): if d.module_path != vim.current.buffer.name: vim.eval('jedi#new_buffer(%s)' % \ repr(PythonToVimStr(d.module_path))) - vim.current.window.cursor = d.line_nr, d.column + vim.current.window.cursor = d.line, d.column vim.command('normal! zt') # cursor at top of screen else: # multiple solutions From 6f107578ee6a7f9c393a349910a8fa1deeaf133e Mon Sep 17 00:00:00 2001 From: heavenshell Date: Sat, 1 Jun 2013 00:50:02 +0900 Subject: [PATCH 5/7] Fix related_names() deprecation. --- plugin/jedi_vim.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/jedi_vim.py b/plugin/jedi_vim.py index 18e5b35..a9c2fca 100644 --- a/plugin/jedi_vim.py +++ b/plugin/jedi_vim.py @@ -105,7 +105,7 @@ def goto(is_definition=False, is_related_name=False, no_output=False): script = get_script() try: if is_related_name: - definitions = script.related_names() + definitions = script.usages() elif is_definition: definitions = script.goto_definitions() else: From a8422d368283d147b4e43b194d097f225867ce4f Mon Sep 17 00:00:00 2001 From: heavenshell Date: Sat, 1 Jun 2013 00:56:04 +0900 Subject: [PATCH 6/7] Fix get_in_function_call() deprecation. --- plugin/jedi_vim.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/jedi_vim.py b/plugin/jedi_vim.py index a9c2fca..5f88a3e 100644 --- a/plugin/jedi_vim.py +++ b/plugin/jedi_vim.py @@ -200,7 +200,8 @@ def show_func_def(call_def=None, completion_lines=0): return try: if call_def == None: - call_def = get_script().get_in_function_call() + sig = get_script().call_signatures() + call_def = sig[0] if sig else None clear_func_def() if call_def is None: From 9c3e9dbe03a7174ba43780a48608ace74b735332 Mon Sep 17 00:00:00 2001 From: heavenshell Date: Sat, 1 Jun 2013 00:59:49 +0900 Subject: [PATCH 7/7] Fix goto() deprecation. --- plugin/jedi.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/jedi.vim b/plugin/jedi.vim index 640b2f3..ac36f14 100644 --- a/plugin/jedi.vim +++ b/plugin/jedi.vim @@ -68,7 +68,7 @@ if 1: text = 'import %s' % args.pop() scr = jedi.Script(text, 1, len(text), '') try: - path = scr.goto()[0].module_path + path = scr.goto_assignments()[0].module_path except IndexError: path = None if path and osp.isfile(path):