aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-09-07 03:45:04 +0200
committerWilliam Boman <william@redwill.se>2021-09-07 03:45:04 +0200
commit788ed85039f53b30d53790af0d9a33182e6a18e8 (patch)
tree297457872c10f6367bcc369413b554757d74a954 /lua/nvim-lsp-installer.lua
parentsome fixes (diff)
downloadmason-788ed85039f53b30d53790af0d9a33182e6a18e8.tar
mason-788ed85039f53b30d53790af0d9a33182e6a18e8.tar.gz
mason-788ed85039f53b30d53790af0d9a33182e6a18e8.tar.bz2
mason-788ed85039f53b30d53790af0d9a33182e6a18e8.tar.lz
mason-788ed85039f53b30d53790af0d9a33182e6a18e8.tar.xz
mason-788ed85039f53b30d53790af0d9a33182e6a18e8.tar.zst
mason-788ed85039f53b30d53790af0d9a33182e6a18e8.zip
schedule batch uninstallations
Diffstat (limited to 'lua/nvim-lsp-installer.lua')
-rw-r--r--lua/nvim-lsp-installer.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer.lua b/lua/nvim-lsp-installer.lua
index 27727370..5b3e7cff 100644
--- a/lua/nvim-lsp-installer.lua
+++ b/lua/nvim-lsp-installer.lua
@@ -27,6 +27,21 @@ function M.uninstall(server_name)
status_win().open()
end
+function M.uninstall_all()
+ local installed_servers = servers.get_installed_servers()
+ if #installed_servers > 0 then
+ local function uninstall(idx)
+ status_win().uninstall_server(installed_servers[idx])
+ if installed_servers[idx + 1] then
+ vim.schedule(function()
+ uninstall(idx + 1)
+ end)
+ end
+ end
+ uninstall(1)
+ end
+end
+
function M.on_server_ready(cb)
dispatcher.register_server_ready_callback(cb)
vim.schedule(function()