diff options
author | Christian Segundo | 2024-07-12 12:09:07 +0200 |
---|---|---|
committer | Christian Segundo | 2024-07-12 12:09:07 +0200 |
commit | 389f81243903508127131d8c20fd6a222e0fcadc (patch) | |
tree | 6174684c2be265fd00f6252a2e72367dbbbc9ccb /lua/plugins/lang/json.lua | |
parent | cc1d8e4c6ae039edf20c80c6c38a699594620dcb (diff) | |
download | config-389f81243903508127131d8c20fd6a222e0fcadc.tar.gz |
fix jsonls
Diffstat (limited to 'lua/plugins/lang/json.lua')
-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, + }, } |