LunarVim/lua/lsp/providers/jsonls.lua
kylo252 d01ba08eae
refactor: auto-generate language configuration (#1584)
Refactor the monolithic `lvim.lang` design into a more modular approach.

IMPORTANT: run `:LvimUpdate` in order to generate the new ftplugin template files.
2021-10-03 16:13:46 +02:00

30 lines
622 B
Lua

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