WhoIsSethDaniel / mason-tool-installer.nvim

Install and upgrade third party tools automatically
MIT License
399 stars 15 forks source link

Support fetching packages directly from existing configuration #26

Open dagadbm opened 1 year ago

dagadbm commented 1 year ago

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

WhoIsSethDaniel commented 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?

joshmedeski commented 6 months ago

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.

henry-hsieh commented 6 months ago

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
  },

})
joshmedeski commented 6 months ago

Good idea, I guess having at least one table referencing the LSPs I use can be helpful (especially when installing on a new machine).