♻️ refactor(nvim): use new mason and treesitter ensure_installed

This commit is contained in:
Sergio Laín 2024-06-08 12:39:35 +02:00
parent 74adfbcc2f
commit c1482fa2c7
No known key found for this signature in database
GPG key ID: FB00AF7015FFE76B
23 changed files with 145 additions and 162 deletions

View file

@ -2,9 +2,11 @@ return {
{ import = "lazyvim.plugins.extras.formatting.prettier" }, { import = "lazyvim.plugins.extras.formatting.prettier" },
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
table.insert(opts.ensure_installed, "prettierd") ensure_installed = {
end, "prettierd",
},
},
}, },
{ {
"stevearc/conform.nvim", "stevearc/conform.nvim",

View file

@ -10,9 +10,10 @@ return {
}, },
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
opts.ensure_installed = opts.ensure_installed or {} ensure_installed = {
vim.list_extend(opts.ensure_installed, { "ruff" }) "ruff",
end, },
},
}, },
} }

View file

@ -1,10 +1,11 @@
return { return {
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
opts.ensure_installed = opts.ensure_installed or {} ensure_installed = {
vim.list_extend(opts.ensure_installed, { "rustywind" }) "rustywind",
end, },
},
}, },
{ {
"stevearc/conform.nvim", "stevearc/conform.nvim",

View file

@ -21,9 +21,10 @@ return {
}, },
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
opts.ensure_installed = opts.ensure_installed or {} ensure_installed = {
vim.list_extend(opts.ensure_installed, { "shfmt" }) "shfmt",
end, },
},
}, },
} }

View file

@ -22,10 +22,11 @@ return {
{ import = "lazyvim.plugins.extras.lang.ansible" }, { import = "lazyvim.plugins.extras.lang.ansible" },
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
opts.ensure_installed = opts.ensure_installed or {} ensure_installed = {
vim.list_extend(opts.ensure_installed, { "ansible-language-server" }) "ansible-language-server",
end, },
},
}, },
{ {
"mfussenegger/nvim-lint", "mfussenegger/nvim-lint",

View file

@ -1,11 +1,11 @@
return { return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = function(_, opts) opts = {
if type(opts.ensure_installed) == "table" then ensure_installed = {
vim.list_extend(opts.ensure_installed, { "bash" }) "bash",
end },
end, },
}, },
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
@ -17,10 +17,12 @@ return {
}, },
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
opts.ensure_installed = opts.ensure_installed or {} ensure_installed = {
vim.list_extend(opts.ensure_installed, { "bash-language-server", "shellcheck" }) "bash-language-server",
end, "shellcheck",
},
},
}, },
{ {
"mfussenegger/nvim-lint", "mfussenegger/nvim-lint",

View file

@ -2,10 +2,11 @@ return {
{ import = "lazyvim.plugins.extras.lang.go" }, { import = "lazyvim.plugins.extras.lang.go" },
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
opts.ensure_installed = opts.ensure_installed or {} ensure_installed = {
vim.list_extend(opts.ensure_installed, { "golangci-lint" }) "golangci-lint",
end, },
},
}, },
{ {
"ray-x/go.nvim", "ray-x/go.nvim",

View file

@ -1,11 +1,11 @@
return { return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = function(_, opts) opts = {
if type(opts.ensure_installed) == "table" then ensure_installed = {
vim.list_extend(opts.ensure_installed, { "julia" }) "julia",
end },
end, },
}, },
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
@ -17,10 +17,11 @@ return {
}, },
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
opts.ensure_installed = opts.ensure_installed or {} ensure_installed = {
vim.list_extend(opts.ensure_installed, { "julia-lsp" }) "julia-lsp",
end, },
},
}, },
{ {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",

View file

@ -61,11 +61,11 @@ return {
}, },
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = function(_, opts) opts = {
if type(opts.ensure_installed) == "table" then ensure_installed = {
vim.list_extend(opts.ensure_installed, { "requirements" }) "requirements",
end },
end, },
}, },
{ {
"MeanderingProgrammer/py-requirements.nvim", "MeanderingProgrammer/py-requirements.nvim",

View file

@ -2,11 +2,11 @@ return {
{ import = "plugins.extras.lang.web.typescript-extended" }, { import = "plugins.extras.lang.web.typescript-extended" },
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
vim.list_extend(opts.ensure_installed, { ensure_installed = {
"graphql-language-service-cli", "graphql-language-service-cli",
}) },
end, },
}, },
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",

View file

@ -1,13 +1,13 @@
return { return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = function(_, opts) opts = {
vim.list_extend(opts.ensure_installed, { ensure_installed = {
"html", "html",
"css", "css",
"scss", "scss",
}) },
end, },
}, },
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
@ -42,9 +42,8 @@ return {
}, },
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
opts.ensure_installed = opts.ensure_installed or {} ensure_installed = {
vim.list_extend(opts.ensure_installed, {
"emmet-language-server", "emmet-language-server",
"html-lsp", "html-lsp",
"cssmodules-language-server", "cssmodules-language-server",
@ -52,8 +51,8 @@ return {
"css-lsp", "css-lsp",
"htmlhint", "htmlhint",
"stylelint", "stylelint",
}) },
end, },
}, },
{ {
"mfussenegger/nvim-lint", "mfussenegger/nvim-lint",

View file

@ -9,9 +9,10 @@ return {
}, },
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
opts.ensure_installed = opts.ensure_installed or {} ensure_installed = {
vim.list_extend(opts.ensure_installed, { "htmx-lsp" }) "htmx-lsp",
end, },
},
}, },
} }

View file

@ -1,28 +1,19 @@
return { return {
{ import = "lazyvim.plugins.extras.lang.php" },
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = function(_, opts) opts = {
vim.list_extend(opts.ensure_installed, { ensure_installed = {
"php",
"phpdoc", "phpdoc",
}) },
end, },
}, },
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
vim.list_extend(opts.ensure_installed, { ensure_installed = {
"phpactor",
"php-cs-fixer", "php-cs-fixer",
"phpcs", "phpcs",
})
end,
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
phpactor = {},
}, },
}, },
}, },
@ -34,27 +25,6 @@ return {
return opts return opts
end, end,
}, },
{
"mfussenegger/nvim-dap",
optional = true,
dependencies = {
"williamboman/mason.nvim",
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
table.insert(opts.ensure_installed, "php-debug-adapter")
end
end,
},
opts = function()
local dap = require("dap")
local path = require("mason-registry").get_package("php-debug-adapter"):get_install_path()
dap.adapters.php = {
type = "executable",
command = "node",
args = { path .. "/extension/out/phpDebug.js" },
}
end,
},
{ {
"nvim-neotest/neotest", "nvim-neotest/neotest",
optional = true, optional = true,

View file

@ -3,10 +3,11 @@ return {
{ import = "plugins.extras.lang.json-extended" }, { import = "plugins.extras.lang.json-extended" },
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
opts.ensure_installed = opts.ensure_installed or {} ensure_installed = {
vim.list_extend(opts.ensure_installed, { "deno" }) "deno",
end, },
},
}, },
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
@ -31,12 +32,12 @@ return {
}, },
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = function(_, opts) opts = {
vim.list_extend(opts.ensure_installed, { ensure_installed = {
"javascript", "javascript",
"jsdoc", "jsdoc",
}) },
end, },
}, },
{ {
"dmmulroy/tsc.nvim", "dmmulroy/tsc.nvim",

View file

@ -1,11 +1,11 @@
return { return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = function(_, opts) opts = {
if type(opts.ensure_installed) == "table" then ensure_installed = {
vim.list_extend(opts.ensure_installed, { "vue" }) "vue",
end },
end, },
}, },
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
@ -20,10 +20,11 @@ return {
}, },
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
opts.ensure_installed = opts.ensure_installed or {} ensure_installed = {
vim.list_extend(opts.ensure_installed, { "vetur-vls" }) "vetur-vls",
end, },
},
}, },
{ {
"luckasRanarison/nvim-devdocs", "luckasRanarison/nvim-devdocs",

View file

@ -39,13 +39,6 @@ return {
"dmmulroy/ts-error-translator.nvim", "dmmulroy/ts-error-translator.nvim",
opts = {}, opts = {},
}, },
{
"williamboman/mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "vue-language-server" })
end,
},
{ {
"luckasRanarison/nvim-devdocs", "luckasRanarison/nvim-devdocs",
optional = true, optional = true,

View file

@ -1,11 +1,11 @@
return { return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = function(_, opts) opts = {
if type(opts.ensure_installed) == "table" then ensure_installed = {
vim.list_extend(opts.ensure_installed, { "xml" }) "xml",
end },
end, },
}, },
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
@ -17,9 +17,10 @@ return {
}, },
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
opts.ensure_installed = opts.ensure_installed or {} ensure_installed = {
vim.list_extend(opts.ensure_installed, { "lemminx" }) "lemminx",
end, },
},
}, },
} }

View file

@ -1,11 +1,11 @@
return { return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = function(_, opts) opts = {
if type(opts.ensure_installed) == "table" then ensure_installed = {
vim.list_extend(opts.ensure_installed, { "zig" }) "zig",
end },
end, },
}, },
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
@ -17,10 +17,12 @@ return {
}, },
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
opts.ensure_installed = opts.ensure_installed or {} ensure_installed = {
vim.list_extend(opts.ensure_installed, { "zls", "codelldb" }) "zls",
end, "codelldb",
},
},
}, },
{ {
"nvim-neotest/neotest", "nvim-neotest/neotest",

View file

@ -1,10 +1,11 @@
return { return {
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
opts.ensure_installed = opts.ensure_installed or {} ensure_installed = {
vim.list_extend(opts.ensure_installed, { "biome" }) "biome",
end, },
},
}, },
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",

View file

@ -1,10 +1,11 @@
return { return {
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
opts.ensure_installed = opts.ensure_installed or {} ensure_installed = {
vim.list_extend(opts.ensure_installed, { "pylint" }) "pylint",
end, },
},
}, },
{ {
"mfussenegger/nvim-lint", "mfussenegger/nvim-lint",

View file

@ -1,10 +1,11 @@
return { return {
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
opts.ensure_installed = opts.ensure_installed or {} ensure_installed = {
vim.list_extend(opts.ensure_installed, { "selene" }) "selene",
end, },
},
}, },
{ {
"mfussenegger/nvim-lint", "mfussenegger/nvim-lint",

View file

@ -1,10 +1,11 @@
return { return {
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
opts.ensure_installed = opts.ensure_installed or {} ensure_installed = {
vim.list_extend(opts.ensure_installed, { "typos" }) "typos",
end, },
},
}, },
{ {
"mfussenegger/nvim-lint", "mfussenegger/nvim-lint",

View file

@ -1,10 +1,11 @@
return { return {
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = function(_, opts) opts = {
opts.ensure_installed = opts.ensure_installed or {} ensure_installed = {
vim.list_extend(opts.ensure_installed, { "vale" }) "vale",
end, },
},
}, },
{ {
"mfussenegger/nvim-lint", "mfussenegger/nvim-lint",