svelte.lua 760 B

1234567891011121314151617181920212223242526272829303132333435
  1. local M = {}
  2. M.config = function()
  3. O.lang.svelte = {}
  4. end
  5. M.format = function()
  6. -- TODO: implement formatter (if applicable)
  7. return "No formatter configured!"
  8. end
  9. M.lint = function()
  10. -- TODO: implement linters (if applicable)
  11. return "No linters configured!"
  12. end
  13. M.lsp = function()
  14. if require("lv-utils").check_lsp_client_active "svelte" then
  15. return
  16. end
  17. require("lspconfig").svelte.setup {
  18. cmd = { DATA_PATH .. "/lspinstall/svelte/node_modules/.bin/svelteserver", "--stdio" },
  19. filetypes = { "svelte" },
  20. root_dir = require("lspconfig.util").root_pattern("package.json", ".git"),
  21. on_attach = require("lsp").common_on_attach,
  22. }
  23. end
  24. M.dap = function()
  25. -- TODO: implement dap
  26. return "No DAP configured!"
  27. end
  28. return M