zsh.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. local M = {}
  2. M.config = function()
  3. -- TODO: implement config for language
  4. return "No config available!"
  5. end
  6. M.format = function()
  7. -- TODO: implement format for language
  8. return "No format available!"
  9. end
  10. M.lint = function()
  11. -- zsh
  12. local zsh_arguments = {}
  13. if not require("lv-utils").check_lsp_client_active "efm" then
  14. require("lspconfig").efm.setup {
  15. -- init_options = {initializationOptions},
  16. cmd = { DATA_PATH .. "/lspinstall/efm/efm-langserver" },
  17. init_options = { documentFormatting = true, codeAction = false },
  18. root_dir = require("lspconfig").util.root_pattern ".git/",
  19. filetypes = { "zsh" },
  20. settings = {
  21. rootMarkers = { ".git/" },
  22. languages = {
  23. zsh = zsh_arguments,
  24. },
  25. },
  26. }
  27. end
  28. end
  29. M.lsp = function()
  30. if not require("lv-utils").check_lsp_client_active "bashls" then
  31. -- npm i -g bash-language-server
  32. require("lspconfig").bashls.setup {
  33. cmd = { DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server", "start" },
  34. on_attach = require("lsp").common_on_attach,
  35. filetypes = { "sh", "zsh" },
  36. }
  37. end
  38. end
  39. M.dap = function()
  40. -- TODO: implement dap
  41. return "No DAP configured!"
  42. end
  43. return M