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.
This commit is contained in:
Daniel Hahler
2015-08-19 23:57:29 +02:00
parent 7890339ca8
commit ed09c7c1af
2 changed files with 10 additions and 0 deletions

View File

@@ -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)

View File

@@ -30,4 +30,6 @@ endif
" Pyimport command
command! -nargs=1 -complete=custom,jedi#py_import_completions Pyimport :call jedi#py_import(<q-args>)
command! -nargs=0 JediDebugInfo call jedi#debug_info()
" vim: set et ts=4: