mason-tool-installer.nvim icon indicating copy to clipboard operation
mason-tool-installer.nvim copied to clipboard

How to extends `ensure_installed` dynamically upon `BufReadPre`

Open nurrony opened this issue 1 year ago • 2 comments

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

nurrony avatar Mar 25 '24 21:03 nurrony

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

clorl avatar Aug 12 '24 22:08 clorl