json.lua 425 B

1234567891011121314151617
  1. -- npm install -g vscode-json-languageserver
  2. require("lspconfig").jsonls.setup {
  3. cmd = {
  4. "node",
  5. DATA_PATH .. "/lspinstall/json/vscode-json/json-language-features/server/dist/node/jsonServerMain.js",
  6. "--stdio",
  7. },
  8. on_attach = require("lsp").common_on_attach,
  9. commands = {
  10. Format = {
  11. function()
  12. vim.lsp.buf.range_formatting({}, { 0, 0 }, { vim.fn.line "$", 0 })
  13. end,
  14. },
  15. },
  16. }