python-lsp / python-lsp-server

Fork of the python-language-server project, maintained by the Spyder IDE team and the community
MIT License
1.75k stars 187 forks source link

Go to definition doesn't work on modules? #549

Closed fishBone000 closed 2 months ago

fishBone000 commented 2 months ago

I'm using nvim, NvChad to be more specific.
I can "go to definition" on functions, variables e.t.c., but it doesn't work on modules. I expect the lsp to guide me to the source code of modules.

I don't know if pylsp doesn't support this, or there's something wrong with my config?
I am willing to dig down for troubleshooting. Thanks!

Abishevs commented 2 months ago

probably depends? Trying out this lsp rn. I have an module installed in editable mode by its relative path. So it can find modules within the parent but not in my localy installed module.

It doesn't work for any module?

fishBone000 commented 2 months ago

UGHHHH, further testing shows that I forgot to do conda activate before I start my nvim. Now pylsp leads me to the modules' source code.

Perhaps add warning if going to definition of a module which is not found?

Abishevs commented 2 months ago

Pretty sure the error is that nothing happens :D which means its not found, sometimes "No information available" comes up in prompt line. But thats a feature of hover inline definitions (I think)

fishBone000 commented 2 months ago

Hmmm I think you are right, I tested with clangd and lua_ls, both don't show error message when definition not found.
Closing this issue.