summaryrefslogtreecommitdiff
path: root/lua/lsp/providers/jsonls.lua
blob: 55bc1ea2b9bf798fe9f1c004e507000fe83d1cbc (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
26
27
28
29
30
local schemas = nil
local status_ok, jsonls_settings = pcall(require, "nlspsettings.jsonls")
if status_ok then
  schemas = jsonls_settings.get_default_schemas()
end

local opts = {
  setup = {
    settings = {
      json = {
        schemas = schemas,
        --   = {
        --   {
        --     fileMatch = { "package.json" },
        --     url = "https://json.schemastore.org/package.json",
        --   },
        -- },
      },
    },
    commands = {
      Format = {
        function()
          vim.lsp.buf.range_formatting({}, { 0, 0 }, { vim.fn.line "$", 0 })
        end,
      },
    },
  },
}

return opts