I'm using #neovim for #python development. But now in new project I've a codebase where nvim jump-to-definition is not working. Do you know maybe how to fix it?
Have a look at this minimum reproduction: https://gist.github.com/dejvidq/9fe98ce31b99f6589b57e447d2d92163
Normally, I'd like to have my cursor on "method_a" and press "gd" to get me to the definition of method_a in SomeClass. But it's not working, nothing is happening, LSP has no idea what to do.
I checked pycharm and it works there
My nvim conf: https://codeberg.org/djvdq/dotfiles/src/branch/master/nvim
The same happens the other way around, with go-to-reference, nvim lsp has no idea about those methods used inside pytest test, but again, pycharm has no problem with it.
But I don't want to switch to pycharm, I'm too used to Nvim and work inside a terminal to leave it.
@djvdq i think it's because of fixture magic, not sure how pycharm integrates with that, but in my experience, lsp doesn't understand that.
maybe try adding the typing on the function parameter taking the fixture.
@tshirtman
Changing:
> test_something(wrapper_class_fixture)
to:
> test_something(wrapper_class_fixture: SomeWrapperClass)
helps indeed!
Thanks, it's easy to fix, but I somehow haven't thought about it.