astro-nvim/lua/plugins/yaml.lua

51 lines
1.4 KiB
Lua

return {
{
"b0o/SchemaStore.nvim",
lazy = true,
dependencies = {
{
"AstroNvim/astrolsp",
optional = true,
---@type AstroLSPOpts
opts = {
---@diagnostic disable: missing-fields
config = {
yamlls = {
on_new_config = function(config)
config.settings.yaml.schemas = vim.tbl_deep_extend(
"force",
config.settings.yaml.schemas or {},
require("schemastore").yaml.schemas()
)
end,
settings = { yaml = { schemaStore = { enable = false, url = "" } } },
},
},
},
},
},
},
{
"nvim-treesitter/nvim-treesitter",
optional = true,
opts = function(_, opts)
if opts.ensure_installed ~= "all" then
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "yaml" })
end
end,
},
{
"williamboman/mason-lspconfig.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "yamlls" })
end,
},
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "yaml-language-server" })
end,
},
}