diff --git a/after/syntax/python.vim b/after/syntax/python.vim index e10c5ca..fa24611 100644 --- a/after/syntax/python.vim +++ b/after/syntax/python.vim @@ -1,4 +1,4 @@ -if g:jedi#show_function_definition == 1 && has('conceal') +if g:jedi#show_call_signatures == 1 && has('conceal') " conceal is normal for vim >= 7.3 let e = g:jedi#function_definition_escape diff --git a/autoload/jedi.vim b/autoload/jedi.vim index c17e496..5867081 100644 --- a/autoload/jedi.vim +++ b/autoload/jedi.vim @@ -11,7 +11,7 @@ function! jedi#get_definition() endfunction -function! jedi#related_names() +function! jedi#usages() Python jedi_vim.goto(is_related_name=True) endfunction @@ -43,10 +43,10 @@ function! jedi#disable_debugging() endfunction " ------------------------------------------------------------------------ -" show_pydoc +" show_documentation " ------------------------------------------------------------------------ -function! jedi#show_pydoc() - Python jedi_vim.show_pydoc() +function! jedi#show_documentation() + Python jedi_vim.show_documentation() if bufnr("__doc__") > 0 " If the __doc__ buffer is open in the current window, jump to it silent execute "sbuffer ".bufnr("__doc__") @@ -158,7 +158,7 @@ function! jedi#do_popup_on_dot() return 1 endfunc -function! jedi#configure_call_signature() +function! jedi#configure_call_signatures() autocmd InsertLeave Python jedi_vim.clear_call_signatures() autocmd CursorMovedI call jedi#show_call_signatures() endfunction diff --git a/ftplugin/python/jedi.vim b/ftplugin/python/jedi.vim index 7dd65ff..ff0f221 100644 --- a/ftplugin/python/jedi.vim +++ b/ftplugin/python/jedi.vim @@ -11,7 +11,7 @@ if g:jedi#auto_initialization setlocal omnifunc=jedi#completions " map ctrl+space for autocompletion - if g:jedi#autocompletion_command == "" + if g:jedi#completions_command == "" " in terminals, sometimes equals inoremap pumvisible() \|\| &omnifunc == '' ? \ "\C-n>" : @@ -19,19 +19,19 @@ if g:jedi#auto_initialization \ "\"\\c-n>\\c-p>\\c-n>\" :" . \ "\" \\bs>\\C-n>\"\" endif - execute "inoremap ".g:jedi#autocompletion_command." " + execute "inoremap ".g:jedi#completions_command." " " goto / get_definition / related_names - execute "noremap ".g:jedi#goto_command." :call jedi#goto()" - execute "noremap ".g:jedi#get_definition_command." :call jedi#get_definition()" - execute "noremap ".g:jedi#related_names_command." :call jedi#related_names()" + execute "noremap ".g:jedi#goto_assignments_command." :call jedi#goto()" + execute "noremap ".g:jedi#goto_definitions_command." :call jedi#get_definition()" + execute "noremap ".g:jedi#usages_command." :call jedi#related_names()" " rename execute "noremap ".g:jedi#rename_command." :call jedi#rename()" - " pydoc - execute "nnoremap ".g:jedi#pydoc." :call jedi#show_pydoc()" + " documentation/pydoc + execute "nnoremap ".g:jedi#documentation_command." :call jedi#show_documentation()" - if g:jedi#show_function_definition == 1 && has('conceal') - call jedi#configure_call_signature() + if g:jedi#show_call_signatures == 1 && has('conceal') + call jedi#configure_call_signatures() endif end diff --git a/plugin/jedi.vim b/plugin/jedi.vim index 0e44137..3a8dabc 100644 --- a/plugin/jedi.vim +++ b/plugin/jedi.vim @@ -17,21 +17,45 @@ if exists("g:loaded_jedi") || &cp endif let g:loaded_jedi = 1 + +" ------------------------------------------------------------------------ +" deprecations +" ------------------------------------------------------------------------ + +let s:deprecations = { + \ 'get_definition_command': 'goto_definitions_command', + \ 'goto_command': 'goto_assignments_command', + \ 'pydoc': 'documentation_command', + \ 'related_names_command': 'usages_command', + \ 'autocompletion_command': 'completions_command', + \ 'show_function_definition': 'show_call_signatures', +} + +for [key, val] in items(s:settings) + if exists('g:jedi#'.key) + echom "'g:jedi#".key."' is deprecated. Please use 'g:jedi#".value."' instead. Sorry for the inconvenience." + exe 'let g:jedi#'.val.' = g:jedi#'.key + end +endfor + + " ------------------------------------------------------------------------ " defaults for jedi-vim " ------------------------------------------------------------------------ + let s:settings = { \ 'use_tabs_not_buffers': 1, \ 'auto_initialization': 1, \ 'auto_vim_configuration': 1, - \ 'goto_command': "'g'", - \ 'autocompletion_command': "''", - \ 'get_definition_command': "'d'", - \ 'related_names_command': "'n'", + \ 'goto_assignments_command': "'g'", + \ 'completions_command': "''", + \ 'goto_definitions_command': "'d'", + \ 'call_signatures_command': "'n'", + \ 'usages_command': "'n'", \ 'rename_command': "'r'", \ 'popup_on_dot': 1, - \ 'pydoc': "'K'", - \ 'show_function_definition': 1, + \ 'documentation_command': "'K'", + \ 'show_call_signatures': 1, \ 'call_signature_escape': "'≡'", \ 'auto_close_doc': 1, \ 'popup_select_first': 1, @@ -52,7 +76,7 @@ if g:jedi#auto_initialization " this is only here because in some cases the VIM library adds their " autocompletion as a default, which may cause problems, depending on the " order of invocation. - autocmd FileType Python setlocal omnifunc=jedi#completions switchbuf=useopen " needed for pydoc + autocmd FileType Python setlocal omnifunc=jedi#completions switchbuf=useopen " needed for documentation/pydoc endif fun! Pyimport(cmd, args) diff --git a/plugin/jedi_vim.py b/plugin/jedi_vim.py index 6c471fb..c701074 100644 --- a/plugin/jedi_vim.py +++ b/plugin/jedi_vim.py @@ -161,7 +161,7 @@ def goto(is_definition=False, is_related_name=False, no_output=False): return definitions -def show_pydoc(): +def show_documentation(): script = get_script() try: definitions = script.goto_definitions() @@ -200,7 +200,7 @@ def clear_call_signatures(): def show_call_signatures(call_def=None, completion_lines=0): - if vim.eval("has('conceal') && g:jedi#show_function_definition") == '0': + if vim.eval("has('conceal') && g:jedi#show_call_signatures") == '0': return try: if call_def == None: