nvim-lsp-installer
nvim-lsp-installer copied to clipboard
[Feature] Add a `LspUpdateAll` command
Can you please add a LspUpdateAll
command that updates all of the installed servers and restarts them so they'll replace the old ones?
Yep this is on the roadmap. What I want to solve first is to only update servers that actually needs updating. I think just naively re-installing all installed servers doesn't cut it. Solving this will also enable cool interop with plugin managers, like:
use { "williamboman/nvim-lsp-installer", run = ":LspUpdateAll" }
There might be some more info in this thread if you're interested: https://github.com/williamboman/nvim-lsp-installer/issues/90
Also, I'd like to solve #154 before doing this as well. Currently if the updating of a server fails, the server will effectively become uninstalled. This'll be really annoying if you're offline or if there's something else causing trouble.
A little sneak peak
https://user-images.githubusercontent.com/6705160/141648667-94218eb8-95ad-46c9-884f-3e65b393d92c.mov
Update: The complexity in implementing this (in a robust and undiscriminating1 manner) is that there's virtually no information stored about installed servers - other than the fact that it's "installed" (its directory exists on the filesystem). The only cases when some sort of metadata stored is when a server is installed through a package manager such as npm
, as npm will capture some metadata in package.json
. After some experimentation I think I've settled on an approach, where an installation receipt will be saved on the fs (as JSON), to be used for persisting metadata that otherwise is only available in-memory at the point of installation.
Also, I've merged #353 which gives easy access to update all installed servers through the UI window (default keybind is U
).
1 - what I mean by this is that servers that are installed through entirely custom methods (such as building something from source) should not be excluded
See https://github.com/williamboman/nvim-lsp-installer/pull/395 for an initial implementation of checking for outdated servers. It's currently only tied to the UI (no command yet, will add later, will have to think about rate limiting and whatnot first).
Please give it a try if you'd like (branch outdated-servers
). Note that it will only work with your currently installed servers if you've recently updated the plugin version (it requires at least https://github.com/williamboman/nvim-lsp-installer/pull/379) and recently updated/installed a server. If you install or update a server it will of course be able to check its versions going forward.
:LspInstallInfo works wonderfully.