mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-07 19:24:36 +08:00
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
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
let s:python_version = 'null'
|
||||||
function! jedi#setup_py_version(py_version)
|
function! jedi#setup_py_version(py_version)
|
||||||
if a:py_version == 2
|
if a:py_version == 2
|
||||||
let cmd_init = 'pyfile'
|
let cmd_init = 'pyfile'
|
||||||
let cmd_exec = 'python'
|
let cmd_exec = 'python'
|
||||||
|
let s:python_version = 2
|
||||||
elseif a:py_version == 3
|
elseif a:py_version == 3
|
||||||
let cmd_init = 'py3file'
|
let cmd_init = 'py3file'
|
||||||
let cmd_exec = 'python3'
|
let cmd_exec = 'python3'
|
||||||
|
let s:python_version = 3
|
||||||
else
|
else
|
||||||
throw "jedi#setup_py_version: invalid py_version: ".a:py_version
|
throw "jedi#setup_py_version: invalid py_version: ".a:py_version
|
||||||
endif
|
endif
|
||||||
@@ -151,6 +154,11 @@ function! jedi#setup_py_version(py_version)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! jedi#debug_info()
|
||||||
|
echom "Using Python version:" s:python_version
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! jedi#force_py_version(py_version)
|
function! jedi#force_py_version(py_version)
|
||||||
let g:jedi#force_py_version = a:py_version
|
let g:jedi#force_py_version = a:py_version
|
||||||
return jedi#setup_py_version(a:py_version)
|
return jedi#setup_py_version(a:py_version)
|
||||||
|
|||||||
@@ -30,4 +30,6 @@ endif
|
|||||||
" Pyimport command
|
" Pyimport command
|
||||||
command! -nargs=1 -complete=custom,jedi#py_import_completions Pyimport :call jedi#py_import(<q-args>)
|
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:
|
" vim: set et ts=4:
|
||||||
|
|||||||
Reference in New Issue
Block a user