WhoIsSethDaniel / mason-tool-installer.nvim

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

How to extends `ensure_installed` dynamically upon `BufReadPre` #44

Open nurrony opened 5 months ago

nurrony commented 5 months ago

I am trying to separate configuration for each language to its own file. I am using lazy.nvim for this. I can easily extends treesitter and lspconfig config as follows from terraform.lua file

return {
  {
    "nvim-treesitter/nvim-treesitter",
    opts = function(_, opts)
      if type(opts.ensure_installed) == "table" then
        vim.list_extend(opts.ensure_installed, {
          "terraform",
          "hcl",
        })
      end
    end,
  },
  {
    "neovim/nvim-lspconfig",
    opts = {
      servers = {
        terraformls = {},
      },
    },
  },
}

I tried extending ensure_installed as same as treesitter shown above. But it did not work. How to separate Language Server and its tool installation like above for this plugin? Also thanks a lot for making this plugin. it makes mason configuration really easy

clorl commented 1 month ago

I have the exact same use case and would love this feature to be added. Right now I have to do an ugly workaround