kabouzeid/nvim-lspinstall

LspInstall prompt for missing servers

axieax opened this issue · 5 comments

Hello,
Is it possible to have an option to display a prompt (y/n) to install missing LSP servers for a language when its file type is open in one of the buffers? This is the case when the language server is not installed, but available to be installed.
Thanks!

You can write an autocmd in your config that uses, require'lspinstall'.is_server_installed(<lang>) and require'lspinstall'.install_server(<lang>) and vim's :confirm for the prompt

I've actually tried experimenting with that yesterday! I was using the BufEnter event, and the installer for some servers (such as Docker iirc) were registered as another buffer with the same filetype as the previous, causing an infinite loop.

Ah yes. Then I don't know a good way right now. I want to write a whole new UI for installing and uninstalling which would also make this much easier, but I haven't had so much time lately.

Understandable, having a UI would definitely simplify this process! Would love to see it as a future feature :)

I wrote a script that parses the file's extension against the installed servers/list of available servers from servers.lua and prompts the user to install, however I'm running into the same behavior that @axieax did.

It technically installed the server, but it spawned other shells in the process as well.

Here's the prompt 🙂
recording

Weird behavior:
recording