Open d-miketa opened 3 years ago
@d-miketa Hey thank you for your response and sorry for responding so late.
I could indeed reproduce that behaviour. The problem here is not that the language server is not found, but the way lspconfig tries to call it.
The lspinstall README says to use following snippet for initialising the install server:
require'lspinstall'.setup() -- important
local servers = require'lspinstall'.installed_servers()
for _, server in pairs(servers) do
require'lspconfig'[server].setup{}
end
The servers
table includes the name of the language, not the name of the language server, something like {"rust", "python", "lua"}
.
So in the end what is called is:
require'lspconfig'['python'].setup()
where cmd
is accordingly updated for the custom install path.
and not:
require'lspconfig'['pyright'].setup()
I will probably put in some checks and look that "python"
is passed to lspconfig
and not "pyright"
when it is installed through lspInstall
Still not working...
https://github.com/kabouzeid/nvim-lspinstall is a convenient plugin to install LSP servers. They end up in a separate directory outside of
$PATH
(~/.local/share/nvim/lspinstall/python/./node_modules/.bin/pyright-langserver
in my case), but https://github.com/kabouzeid/nvim-lspinstall/blob/54b439241e83e0a9ce8f6bcdf3b2c560a2328792/lua/lspinstall.lua#L94 corrects the defaultcmd
forlspconfig
to point to that location. Howeverpy_lsp
doesn't pick up on it for some reason, perhaps overridingcmd
orcmd_cwd
indefault_config
?This is with
py_lsp
installed and used to set up Pyright:And this is with
py_lsp
disabled: (notecmd
)