Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with LSP installed by LspInstall #5

Open
d-miketa opened this issue Sep 10, 2021 · 2 comments · Fixed by #6
Open

Incompatible with LSP installed by LspInstall #5

d-miketa opened this issue Sep 10, 2021 · 2 comments · Fixed by #6

Comments

@d-miketa
Copy link
Contributor

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 default cmd for lspconfig to point to that location. However py_lsp doesn't pick up on it for some reason, perhaps overriding cmd or cmd_cwd in default_config?

This is with py_lsp installed and used to set up Pyright:
image
image

And this is with py_lsp disabled: (note cmd)
image

@HallerPatrick
Copy link
Owner

@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

@HallerPatrick HallerPatrick linked a pull request Sep 16, 2021 that will close this issue
@HallerPatrick HallerPatrick reopened this Sep 14, 2022
@HallerPatrick
Copy link
Owner

Still not working...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants