forked from VimPlug/jedi-vim
Merge pull request #456 from blueyed/add-debug-info
Add JediDebugInfo command: display used Python version
This commit is contained in:
@@ -130,13 +130,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
|
||||
@@ -151,6 +154,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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user