diff options
-rw-r--r-- | lua/plugins/lang/json.lua | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/lua/plugins/lang/json.lua b/lua/plugins/lang/json.lua index 1d2d073..0df3a15 100644 --- a/lua/plugins/lang/json.lua +++ b/lua/plugins/lang/json.lua @@ -1,21 +1,27 @@ return { - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - if type(opts) == "table" then - opts.ensure_installed = opts.ensure_installed or {} - vim.list_extend(opts.ensure_installed, { "json" }) - end - end, - }, + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if type(opts) == "table" then + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "json" }) + end + end, + }, - { - "neovim/nvim-lspconfig", - opts = function(_, opts) - if type(opts) == "table" then - opts.servers = opts.servers or {} - opts.servers.jsonls = {} - end - end, - }, + { + "neovim/nvim-lspconfig", + opts = function(_, opts) + if type(opts) == "table" then + opts.servers = opts.servers or {} + opts.servers.jsonls = { + on_attach = function(client, _) + client.server_capabilities.documentFormattingProvider = true + client.server_capabilities.documentRangeFormattingProvider = true + end, + cmd = { "json-language-server", "--stdio" }, + } + end + end, + }, } |