html.lua 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. local M = {}
  2. M.config = function()
  3. O.lang.html = {
  4. linters = {
  5. "tidy",
  6. -- https://docs.errata.ai/vale/scoping#html
  7. "vale",
  8. },
  9. }
  10. end
  11. M.format = function()
  12. -- TODO: implement formatters (if applicable)
  13. return "No formatters configured!"
  14. end
  15. M.lint = function()
  16. require("lint").linters_by_ft = {
  17. html = O.lang.html.linters,
  18. }
  19. end
  20. M.lsp = function()
  21. if not require("lv-utils").check_lsp_client_active "html" then
  22. -- npm install -g vscode-html-languageserver-bin
  23. local capabilities = vim.lsp.protocol.make_client_capabilities()
  24. capabilities.textDocument.completion.completionItem.snippetSupport = true
  25. require("lspconfig").html.setup {
  26. cmd = {
  27. "node",
  28. DATA_PATH .. "/lspinstall/html/vscode-html/html-language-features/server/dist/node/htmlServerMain.js",
  29. "--stdio",
  30. },
  31. on_attach = require("lsp").common_on_attach,
  32. capabilities = capabilities,
  33. }
  34. end
  35. end
  36. M.dap = function()
  37. -- TODO: implement dap
  38. return "No DAP configured!"
  39. end
  40. return M