Open matthewsia98 opened 1 year ago
It seems to be failing when root directory is my home directory
I get this error every time the directory I'm in is not a git repository. Can we reopen this?
Try this
local lspconfig = require("lspconfig")
local util = require("lspconfig.util")
lspconfig.pylsp.setup({
root_dir = function(fname)
local root_files = {
"pyproject.toml",
"setup.py",
"setup.cfg",
"requirements.txt",
"Pipfile",
}
return util.root_pattern(unpack(root_files))(fname)
or util.find_git_ancestor(fname)
or vim.fn.expand("%:p:h")
end,
In neovim, I am not getting any diagnostics if pylsp is running in single file mode. I do get diagnostics if opening a file under a git repository.
Seems like auto import doesn't work in non project files too