svelte.lua 819 B

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