summaryrefslogtreecommitdiff
path: root/lua/config/lsp/settings/jsonls.lua
blob: 6372822aeb6496b0039f3e2a5a62cdb47fe5ad4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
-- A Json language server config.
local status_ok, schemastore = pcall(require, "schemastore")
if not status_ok then
  return
end

return {
  init_options = {
    provideFormatter = false,
  },
  settings = {
    json = {
      schemas = schemastore.json.schemas(),
    },
  },
  setup = {
    commands = {
      Format = {
        function()
          vim.lsp.buf.range_formatting({}, { 0, 0 }, { vim.fn.line "$", 0 })
        end,
      },
    },
  },
}