61 lines
1.3 KiB
Lua
61 lines
1.3 KiB
Lua
return {
|
|
{
|
|
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
|
dependencies = {
|
|
{ "mason-org/mason.nvim", opts = {} },
|
|
"mason-org/mason-lspconfig.nvim",
|
|
"zapling/mason-conform.nvim",
|
|
},
|
|
config = function()
|
|
local lsp = require("tools.lsp")
|
|
|
|
local ensure_installed = vim.tbl_values(vim.tbl_map(function(tool)
|
|
if type(tool) == "table" then
|
|
if not tool.system then
|
|
return {
|
|
tool[1],
|
|
condition = tool.condition,
|
|
}
|
|
end
|
|
else
|
|
return tool
|
|
end
|
|
return nil
|
|
end, lsp))
|
|
|
|
local formatters_by_ft = require("conform").formatters_by_ft
|
|
local mapping = require("mason-conform.mapping")
|
|
local formatters = vim.iter(formatters_by_ft)
|
|
:filter(function(formatters)
|
|
return type(formatters) ~= "function"
|
|
end)
|
|
:map(function(_, formatters)
|
|
return formatters
|
|
end)
|
|
:totable()
|
|
vim.iter(formatters)
|
|
:flatten()
|
|
:map(function(formatter)
|
|
return mapping.conform_to_package[formatter]
|
|
end)
|
|
:each(function(package)
|
|
table.insert(ensure_installed, package)
|
|
end)
|
|
|
|
require("mason-tool-installer").setup({
|
|
ensure_installed = ensure_installed,
|
|
auto_update = true,
|
|
debounde_hours = 24,
|
|
})
|
|
end,
|
|
},
|
|
{
|
|
"mason-org/mason-lspconfig.nvim",
|
|
opts = {},
|
|
dependencies = {
|
|
{ "mason-org/mason.nvim", opts = {} },
|
|
"neovim/nvim-lspconfig",
|
|
},
|
|
},
|
|
}
|