diff --git a/lua/astrocommunity/pack/json/README.md b/lua/astrocommunity/pack/json/README.md new file mode 100644 index 000000000..993fadf2d --- /dev/null +++ b/lua/astrocommunity/pack/json/README.md @@ -0,0 +1,6 @@ +# JSON Language Pack + +This plugin pack does the following: + +- Adds `json` and `jsonc` Treesitter parsers +- Adds `jsonls` language server diff --git a/lua/astrocommunity/pack/json/json.lua b/lua/astrocommunity/pack/json/json.lua new file mode 100644 index 000000000..bda626638 --- /dev/null +++ b/lua/astrocommunity/pack/json/json.lua @@ -0,0 +1,22 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + -- Ensure that opts.ensure_installed exists and is a table or string "all". + if not opts.ensure_installed then + opts.ensure_installed = {} + elseif opts.ensure_installed == "all" then + return + end + vim.list_extend(opts.ensure_installed, { "json", "jsonc" }) + end, + }, + { + "williamboman/mason-lspconfig.nvim", + opts = function(_, opts) + -- Ensure that opts.ensure_installed exists and is a table + if not opts.ensure_installed then opts.ensure_installed = {} end + table.insert(opts.ensure_installed, "jsonls") + end, + }, +}