nvim-lsp-installer icon indicating copy to clipboard operation
nvim-lsp-installer copied to clipboard

[Feature] Add a `LspUpdateAll` command

Open 5c077m4n opened this issue 3 years ago • 6 comments

Can you please add a LspUpdateAll command that updates all of the installed servers and restarts them so they'll replace the old ones?

5c077m4n avatar Oct 24 '21 12:10 5c077m4n

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

williamboman avatar Oct 24 '21 17:10 williamboman

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.

williamboman avatar Oct 24 '21 17:10 williamboman

A little sneak peak

https://user-images.githubusercontent.com/6705160/141648667-94218eb8-95ad-46c9-884f-3e65b393d92c.mov

williamboman avatar Nov 13 '21 15:11 williamboman

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

williamboman avatar Dec 23 '21 18:12 williamboman

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.

williamboman avatar Jan 05 '22 23:01 williamboman

:LspInstallInfo works wonderfully.

lucax88x avatar Jan 21 '22 09:01 lucax88x