diff options
| author | William Boman <william@redwill.se> | 2021-10-18 13:59:43 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-18 13:59:43 +0200 |
| commit | cee25503cd6df85366c5106c40cc5240634e647e (patch) | |
| tree | 6e242bc0b0c5a6c3e40b165323a6c1a9c20576a1 /lua/nvim-lsp-installer/ui | |
| parent | Remove the pdflatex check (#174) (diff) | |
| download | mason-cee25503cd6df85366c5106c40cc5240634e647e.tar mason-cee25503cd6df85366c5106c40cc5240634e647e.tar.gz mason-cee25503cd6df85366c5106c40cc5240634e647e.tar.bz2 mason-cee25503cd6df85366c5106c40cc5240634e647e.tar.lz mason-cee25503cd6df85366c5106c40cc5240634e647e.tar.xz mason-cee25503cd6df85366c5106c40cc5240634e647e.tar.zst mason-cee25503cd6df85366c5106c40cc5240634e647e.zip | |
speed up :LspInstall, :LspUninstall, :LspUninstallAll commands (#175)
- `:LspUninstallAll` now just nukes the entire install directory immediately,
instead of uninstalling each server one by one. There's also a confirmation
prompt now.
- `:LspInstall` & `:LspUninstall` now sources its autocompletion directly from
a Lua table, instead of sourcing the server names from each server module (thus
avoiding unnecessary `require` calls).
Diffstat (limited to 'lua/nvim-lsp-installer/ui')
| -rw-r--r-- | lua/nvim-lsp-installer/ui/status-win/init.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lua/nvim-lsp-installer/ui/status-win/init.lua b/lua/nvim-lsp-installer/ui/status-win/init.lua index c6f4540f..e8931bce 100644 --- a/lua/nvim-lsp-installer/ui/status-win/init.lua +++ b/lua/nvim-lsp-installer/ui/status-win/init.lua @@ -270,7 +270,7 @@ local function UninstalledServers(servers, expanded_server) Data.list_not_nil( { settings.current.ui.icons.server_uninstalled, "LspInstallerMuted" }, { " " .. server.name, "LspInstallerMuted" }, - Data.when(server.uninstaller.has_run, { " (just uninstalled)", "Comment" }) + Data.when(server.uninstaller.has_run, { " (uninstalled)", "Comment" }) ), }, Ui.Keybind(settings.current.ui.keymaps.toggle_server_expand, "EXPAND_SERVER", { server.name }), @@ -558,6 +558,17 @@ local function init(all_servers) end) end + local function mark_all_servers_uninstalled() + mutate_state(function(state) + for _, server_name in ipairs(lsp_servers.get_available_server_names()) do + if state.servers[server_name].is_installed then + state.servers[server_name].is_installed = false + state.servers[server_name].uninstaller.has_run = true + end + end + end) + end + local start_help_command_animation do local help_command = ":help " @@ -656,6 +667,7 @@ local function init(all_servers) open = open, install_server = install_server, uninstall_server = uninstall_server, + mark_all_servers_uninstalled = mark_all_servers_uninstalled, } end |
