* jedi_vim.jedi_import_error: add location
This is useful for debugging. It contains e.g. the path to parso, if
importing failed from there.
Example:
> Error: jedi-vim failed to initialize Python: jedi#setup_python_imports: could not import jedi: cannot import name 'PythonTokenTypes' (in /…/jedi-vim/pythonx/jedi/jedi/api/completion.py:1). (in function jedi#init_python[3]..<SNR>44_init_python[27]..jedi#setup_python_imports, line 37)
* init: handle jedi_vim.jedi_import_error in Vim plugin
Using `set shortmess+=F` would suppress the `:echom` used in
`jedi_vim.no_jedi_warning` [1].
This patch makes `jedi#setup_python_imports` handle the error instead.
1: https://github.com/neovim/neovim/issues/8675
* Revisit error handling with loading jedi_vim
* jedi#debug_info: display parso submodule separately
* Fix jedi#reinit_python
* fixup! Revisit error handling with loading jedi_vim
* display_debug_info: handle exceptions with environment.get_sys_path
* fixup! Revisit error handling with loading jedi_vim
[ci skip]
- cache current environment
- s/jedi.get_python_environment/jedi.get_system_environment: the former
does not exist (renamed in https://github.com/davidhalter/jedi/commit/336087f)
- improve error display
Squashed:
* fix: CheckHealth doesn't work in neovim
CheckHealth calls display_debug_info().
However, error occured when loading jedi_vim.jedi.Script('')._evaluator.sys_path,
because Evaluator.sys_path is unavailable variable.
* handle the both the old and new API
Evaluator.project.sys_path is temporary fix, because Evaluator.sys_path is correct API.
So, we handle the both the old and new API in preparation for merging virtualenv branch.
This allows vimlparser to parse the vim file again, and it is more
convenient to have it in a real Python file anyway.
Small refactoring and minor text changes included.