Closed samualtnorman closed 4 months ago
You can run this to remove installed packages that are not listed in ensure_installed:
:MasonToolsClean
Or add this to init.lua:
diff --git a/init.lua b/init.lua
index 88658ef..c125657 100644
--- a/init.lua
+++ b/init.lua
@@ -610,6 +610,9 @@ require('lazy').setup({
})
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
+ -- remove mason installed packages that are not listed in ensure_installed
+ require('mason-tool-installer').clean()
+
require('mason-lspconfig').setup {
handlers = {
function(server_name)
Not sure if this should be the default behaviour or not, perhaps it would be too disruptive and then we would get questions like: "Why are the packages that I manually install using Mason uninstalled when I restart nvim?"
@samualtnorman Btw, you seem to be a NixOS user, can you check if you could help with this issue: https://github.com/nvim-lua/kickstart.nvim/issues/924 "Telescope bindings don't work [on NixOS]"
You can run this to remove installed packages that are not listed in ensure_installed:
:MasonToolsClean
Or add this to init.lua:
diff --git a/init.lua b/init.lua index 88658ef..c125657 100644 --- a/init.lua +++ b/init.lua @@ -610,6 +610,9 @@ require('lazy').setup({ }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } + -- remove mason installed packages that are not listed in ensure_installed + require('mason-tool-installer').clean() + require('mason-lspconfig').setup { handlers = { function(server_name)
Not sure if this should be the default behaviour or not, perhaps it would be too disruptive and then we would get questions like: "Why are the packages that I manually install using Mason uninstalled when I restart nvim?"
ty this lua snippet seems to be what I'm looking for
Describe the bug
I would expect language servers removed from the
servers
table to no longer take affect. This is particularly annoying if a language has multiple LSP server options and I change my mind and switch to another.To Reproduce
servers
tableDesktop
Neovim Version