I'm trying to use Jedi to do "jump-to-definition". For example, if my cursor is on MLPClassifier
, I want to be able jump to the place where that class is defined in Python code from the imported library sklearn
.
The documentation and this post suggest that I should be able to do this by pressing "\d" while my cursor is on the function/class. However, this does not work.
I think Jedi is installed correctly because autocomplete suggestions seem to work (for example, typing np.arg
pops up a menu with argmax
, argmin
, etc.). Curiously however, running :help jedi-vim
gives me "E149: Sorry, no help for jedi-vim
".
FYI about my setup:
I am not using a virtual environment. It's a system-level Python 3.9
I'm using Asynchronous Lint Engine (ALE) as my Language Server Protocol (LSP) client.
cd ~/.vim/pack/vendor/start/
git clone [email protected]:dense-analysis/ale.git
- I'm using python-lsp-server as my LSP server. This uses Jedi internally for autocomplete and jump-to-definition.
pip install python-lsp-server
- Here are my plugin-related variables in my
.vimrc
.
let g:ale_linters = {'python': ['pylsp']}
let g:ale_completion_enabled = 1
let g:ale_linters_explicit = 1
let g:ale_sign_column_always = 1
packloadall
silent! helptags ALL-
\d
jumping to definition of a custom function within your python script? Then you could verify that it works across two custom file linked with import.sklearn
to bec
code and thatjedy
can't find the definition. I'll test withcoc
and let you know.coc
andVsCode
.\d
seems to not work for me even for function definitions in the same file! Perhaps I am misinterpreting the docs.