mastodon.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
The original server operated by the Mastodon gGmbH non-profit

Administered by:

Server stats:

352K
active users

Dawid

I'm using for 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: gist.github.com/dejvidq/9fe98c

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: codeberg.org/djvdq/dotfiles/sr

GitHub Gist: instantly share code, notes, and snippets.
Gistmy_pytest_problem.pyGitHub Gist: instantly share code, notes, and snippets.

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.