Is pyright
goto definition command supposed to jump into the different modules?
I import python class like this from a.b.c import Foo
.
When my cursor is on a = Foo()
and I call lua vim.lsp.buf.definition()
nvim jumps only to the top of the file but does not follow the definition into the other module.
Executing the same command on the top import moves nowhere.
I use the following script in my init.vim to set up the root_dir
local util = require("lspconfig/util")
lspconfig.pyright.setup({
root_dir = function(fname)
return util.root_pattern(".git", "setup.py", "setup.cfg", "pyproject.toml", "requirements.txt")(fname) or
util.path.dirname(fname)
end
})