From ed09c7c1af53d722e06f04859af05929f96ee119 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 19 Aug 2015 23:57:29 +0200 Subject: [PATCH] Add JediDebugInfo command: display used Python version This command is meant to come in handy to debug problems with jedi-vim. For now, it will display the Python version that jedi-vim is using. --- autoload/jedi.vim | 8 ++++++++ plugin/jedi.vim | 2 ++ 2 files changed, 10 insertions(+) diff --git a/autoload/jedi.vim b/autoload/jedi.vim index eff65e0..5245253 100644 --- a/autoload/jedi.vim +++ b/autoload/jedi.vim @@ -118,13 +118,16 @@ function! jedi#init_python() endfunction +let s:python_version = 'null' function! jedi#setup_py_version(py_version) if a:py_version == 2 let cmd_init = 'pyfile' let cmd_exec = 'python' + let s:python_version = 2 elseif a:py_version == 3 let cmd_init = 'py3file' let cmd_exec = 'python3' + let s:python_version = 3 else throw "jedi#setup_py_version: invalid py_version: ".a:py_version endif @@ -139,6 +142,11 @@ function! jedi#setup_py_version(py_version) endfunction +function! jedi#debug_info() + echom "Using Python version:" s:python_version +endfunction + + function! jedi#force_py_version(py_version) let g:jedi#force_py_version = a:py_version return jedi#setup_py_version(a:py_version) diff --git a/plugin/jedi.vim b/plugin/jedi.vim index 36afd5b..b6d8c80 100644 --- a/plugin/jedi.vim +++ b/plugin/jedi.vim @@ -30,4 +30,6 @@ endif " Pyimport command command! -nargs=1 -complete=custom,jedi#py_import_completions Pyimport :call jedi#py_import() +command! -nargs=0 JediDebugInfo call jedi#debug_info() + " vim: set et ts=4: