Open dagadbm opened 1 year ago
I may be misunderstanding, but doesn't mason-lspconfig
already install LSP servers automatically? Or are you talking about a configuration other than mason-lspconfig
?
I would like to see this as well, allowing me to update the plugins that are already installed in mason and update any future mason entries that I may add without having to manually add them to this plugin's config file.
To workaround this, you can maintain the LSP list outside the plugin manager. Just assign it to both plugins. However, the native support of this feature is even better.
A lazy.nvim example:
local ensure_lsp = {
"lua_ls",
}
require("lazy").setup({
{
'williamboman/mason-lspconfig.nvim',
dependencies = {
'williamboman/mason.nvim',
},
config = function()
require'mason-lspconfig'.setup{
ensure_installed = ensure_lsp,
}
end
},
{
'WhoIsSethDaniel/mason-tool-installer.nvim',
dependencies = {
'williamboman/mason-lspconfig.nvim',
},
config = function()
require('mason-tool-installer').setup {
ensure_installed = ensure_lsp,
}
end
},
})
Good idea, I guess having at least one table referencing the LSPs I use can be helpful (especially when installing on a new machine).
I currently have mason setup to prefer default lsp configuration by musing mason-lspconfig.
This allows me to keep the lspconfig setup as close as possible to the vanilla nvim experience and just use mason to handle the installs.
It would be helpful if mason-tool-installer would read this configuration automatically and install/update these servers automatically.
Who knows in the future this could all be integrated in mason itself to support mason-lspconfig , mason-null-ls and mason-nvim-dap