mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-07 19:24:36 +08:00
debug info: catch any errors with PythonJedi commands
Ref: https://github.com/davidhalter/jedi-vim/issues/953
This commit is contained in:
committed by
Dave Halter
parent
50abb5e95a
commit
b4b2f3ef54
@@ -198,7 +198,11 @@ function! jedi#debug_info() abort
|
|||||||
echo 'Using Python version '.s:python_version.' to access Jedi.'
|
echo 'Using Python version '.s:python_version.' to access Jedi.'
|
||||||
let pyeval = s:python_version == 3 ? 'py3eval' : 'pyeval'
|
let pyeval = s:python_version == 3 ? 'py3eval' : 'pyeval'
|
||||||
let s:pythonjedi_called = 0
|
let s:pythonjedi_called = 0
|
||||||
|
try
|
||||||
PythonJedi import vim; vim.command('let s:pythonjedi_called = 1')
|
PythonJedi import vim; vim.command('let s:pythonjedi_called = 1')
|
||||||
|
catch
|
||||||
|
echo 'Error when trying to import vim: '.v:exception
|
||||||
|
endtry
|
||||||
if !s:pythonjedi_called
|
if !s:pythonjedi_called
|
||||||
echohl WarningMsg
|
echohl WarningMsg
|
||||||
echom 'PythonJedi failed to run, likely a Python config issue.'
|
echom 'PythonJedi failed to run, likely a Python config issue.'
|
||||||
@@ -207,8 +211,14 @@ function! jedi#debug_info() abort
|
|||||||
endif
|
endif
|
||||||
echohl None
|
echohl None
|
||||||
else
|
else
|
||||||
|
try
|
||||||
PythonJedi from jedi_vim_debug import display_debug_info
|
PythonJedi from jedi_vim_debug import display_debug_info
|
||||||
PythonJedi display_debug_info()
|
PythonJedi display_debug_info()
|
||||||
|
catch
|
||||||
|
echohl WarningMsg
|
||||||
|
echo 'Error when running display_debug_info: '.v:exception
|
||||||
|
echohl None
|
||||||
|
endtry
|
||||||
endif
|
endif
|
||||||
echo "\n"
|
echo "\n"
|
||||||
echo '##### Settings'
|
echo '##### Settings'
|
||||||
|
|||||||
Reference in New Issue
Block a user