config.lua 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. local skipped_servers = {
  2. "angularls",
  3. "ansiblels",
  4. "ccls",
  5. "csharp_ls",
  6. "cssmodules_ls",
  7. "denols",
  8. "ember",
  9. "emmet_ls",
  10. "eslint",
  11. "eslintls",
  12. "golangci_lint_ls",
  13. "graphql",
  14. "jedi_language_server",
  15. "ltex",
  16. "ocamlls",
  17. "phpactor",
  18. "psalm",
  19. "pylsp",
  20. "quick_lint_js",
  21. "rome",
  22. "reason_ls",
  23. "scry",
  24. "solang",
  25. "solidity_ls",
  26. "sorbet",
  27. "sourcekit",
  28. "sourcery",
  29. "spectral",
  30. "sqlls",
  31. "sqls",
  32. "stylelint_lsp",
  33. "tailwindcss",
  34. "tflint",
  35. "verible",
  36. "vuels",
  37. }
  38. local skipped_filetypes = { "markdown", "rst", "plaintext" }
  39. return {
  40. templates_dir = join_paths(get_runtime_dir(), "site", "after", "ftplugin"),
  41. diagnostics = {
  42. signs = {
  43. active = true,
  44. values = {
  45. { name = "DiagnosticSignError", text = "" },
  46. { name = "DiagnosticSignWarn", text = "" },
  47. { name = "DiagnosticSignHint", text = "" },
  48. { name = "DiagnosticSignInfo", text = "" },
  49. },
  50. },
  51. virtual_text = true,
  52. update_in_insert = false,
  53. underline = true,
  54. severity_sort = true,
  55. float = {
  56. focusable = false,
  57. style = "minimal",
  58. border = "rounded",
  59. source = "always",
  60. header = "",
  61. prefix = "",
  62. format = function(d)
  63. local t = vim.deepcopy(d)
  64. local code = d.code or (d.user_data and d.user_data.lsp.code)
  65. if code then
  66. t.message = string.format("%s [%s]", t.message, code):gsub("1. ", "")
  67. end
  68. return t.message
  69. end,
  70. },
  71. },
  72. document_highlight = true,
  73. code_lens_refresh = true,
  74. float = {
  75. focusable = true,
  76. style = "minimal",
  77. border = "rounded",
  78. },
  79. peek = {
  80. max_height = 15,
  81. max_width = 30,
  82. context = 10,
  83. },
  84. on_attach_callback = nil,
  85. on_init_callback = nil,
  86. automatic_servers_installation = true,
  87. automatic_configuration = {
  88. ---@usage list of servers that the automatic installer will skip
  89. skipped_servers = skipped_servers,
  90. ---@usage list of filetypes that the automatic installer will skip
  91. skipped_filetypes = skipped_filetypes,
  92. },
  93. buffer_mappings = {
  94. normal_mode = {
  95. ["K"] = { "<cmd>lua vim.lsp.buf.hover()<CR>", "Show hover" },
  96. ["gd"] = { "<cmd>lua vim.lsp.buf.definition()<CR>", "Goto Definition" },
  97. ["gD"] = { "<cmd>lua vim.lsp.buf.declaration()<CR>", "Goto declaration" },
  98. ["gr"] = { "<cmd>lua vim.lsp.buf.references()<CR>", "Goto references" },
  99. ["gI"] = { "<cmd>lua vim.lsp.buf.implementation()<CR>", "Goto Implementation" },
  100. ["gs"] = { "<cmd>lua vim.lsp.buf.signature_help()<CR>", "show signature help" },
  101. ["gp"] = { "<cmd>lua require'lvim.lsp.peek'.Peek('definition')<CR>", "Peek definition" },
  102. ["gl"] = {
  103. "<cmd>lua require'lvim.lsp.handlers'.show_line_diagnostics()<CR>",
  104. "Show line diagnostics",
  105. },
  106. },
  107. insert_mode = {},
  108. visual_mode = {},
  109. },
  110. null_ls = {
  111. setup = {},
  112. config = {},
  113. },
  114. ---@deprecated use automatic_configuration.skipped_servers instead
  115. override = {},
  116. }