diff options
| author | William Boman <william@redwill.se> | 2021-09-07 03:45:04 +0200 |
|---|---|---|
| committer | William Boman <william@redwill.se> | 2021-09-07 03:45:04 +0200 |
| commit | 788ed85039f53b30d53790af0d9a33182e6a18e8 (patch) | |
| tree | 297457872c10f6367bcc369413b554757d74a954 /lua/nvim-lsp-installer.lua | |
| parent | some fixes (diff) | |
| download | mason-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.lua | 15 |
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() |
