LunarVim/lua/lvim/lsp/config.lua
kylo252 198577aa75
refactor(lsp): cleanup servers' override configuration (#2243)
* refactor(lsp): cleanup override settings

- rename lsp.override to lsp.automatic_configuration.ignored_servers
- add lsp.automatic_configuration.ignored_filetypes

* chore(info): update override section

* refactor(lsp): rename ignored to skipped

* fix: better deprecation handling

* docs(lsp): add example for (un-)skipping servers

* refactor(lsp): allow installing overridden servers

* docs(lsp): update config_win.example.lua as well

* chore(lsp): update skipped_servers list

* fix(logger): less noise from client_is_configured
2022-04-14 23:17:22 +04:30

113 lines
2.9 KiB
Lua

local skipped_servers = {
"angularls",
"ansiblels",
"ccls",
"csharp_ls",
"cssmodules_ls",
"denols",
"ember",
"emmet_ls",
"eslint",
"eslintls",
"golangci_lint_ls",
"graphql",
"jedi_language_server",
"ltex",
"ocamlls",
"phpactor",
"psalm",
"pylsp",
"quick_lint_js",
"rome",
"reason_ls",
"scry",
"solang",
"solidity_ls",
"sorbet",
"sourcekit",
"sourcery",
"spectral",
"sqlls",
"sqls",
"stylelint_lsp",
"tailwindcss",
"tflint",
"verible",
"vuels",
}
local skipped_filetypes = { "markdown", "rst", "plaintext" }
return {
templates_dir = join_paths(get_runtime_dir(), "site", "after", "ftplugin"),
diagnostics = {
signs = {
active = true,
values = {
{ name = "DiagnosticSignError", text = "" },
{ name = "DiagnosticSignWarn", text = "" },
{ name = "DiagnosticSignHint", text = "" },
{ name = "DiagnosticSignInfo", text = "" },
},
},
virtual_text = true,
update_in_insert = false,
underline = true,
severity_sort = true,
float = {
focusable = false,
style = "minimal",
border = "rounded",
source = "always",
header = "",
prefix = "",
format = function(d)
local t = vim.deepcopy(d)
local code = d.code or (d.user_data and d.user_data.lsp.code)
if code then
t.message = string.format("%s [%s]", t.message, code):gsub("1. ", "")
end
return t.message
end,
},
},
document_highlight = true,
code_lens_refresh = true,
float = {
focusable = true,
style = "minimal",
border = "rounded",
},
on_attach_callback = nil,
on_init_callback = nil,
automatic_servers_installation = true,
automatic_configuration = {
---@usage list of servers that the automatic installer will skip
skipped_servers = skipped_servers,
---@usage list of filetypes that the automatic installer will skip
skipped_filetypes = skipped_filetypes,
},
buffer_mappings = {
normal_mode = {
["K"] = { "<cmd>lua vim.lsp.buf.hover()<CR>", "Show hover" },
["gd"] = { "<cmd>lua vim.lsp.buf.definition()<CR>", "Goto Definition" },
["gD"] = { "<cmd>lua vim.lsp.buf.declaration()<CR>", "Goto declaration" },
["gr"] = { "<cmd>lua vim.lsp.buf.references()<CR>", "Goto references" },
["gI"] = { "<cmd>lua vim.lsp.buf.implementation()<CR>", "Goto Implementation" },
["gs"] = { "<cmd>lua vim.lsp.buf.signature_help()<CR>", "show signature help" },
["gp"] = { "<cmd>lua require'lvim.lsp.peek'.Peek('definition')<CR>", "Peek definition" },
["gl"] = {
"<cmd>lua require'lvim.lsp.handlers'.show_line_diagnostics()<CR>",
"Show line diagnostics",
},
},
insert_mode = {},
visual_mode = {},
},
null_ls = {
setup = {},
config = {},
},
---@deprecated use automatic_configuration.skipped_servers instead
override = {},
}