summaryrefslogtreecommitdiff
path: root/lua/config/lsp/settings/jsonls.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/config/lsp/settings/jsonls.lua')
-rw-r--r--lua/config/lsp/settings/jsonls.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/lua/config/lsp/settings/jsonls.lua b/lua/config/lsp/settings/jsonls.lua
new file mode 100644
index 0000000..6372822
--- /dev/null
+++ b/lua/config/lsp/settings/jsonls.lua
@@ -0,0 +1,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,
+ },
+ },
+ },
+}