Skip to content

Commit

Permalink
feat(pack): add json language pack
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter authored and luxus committed Mar 9, 2023
1 parent 95af19a commit 6274d69
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lua/astrocommunity/pack/json/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# JSON Language Pack

This plugin pack does the following:

- Adds `json` and `jsonc` Treesitter parsers
- Adds `jsonls` language server
22 changes: 22 additions & 0 deletions lua/astrocommunity/pack/json/json.lua
Original file line number Diff line number Diff line change
@@ -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,
},
}

0 comments on commit 6274d69

Please sign in to comment.