allow custom handlers, add for eslint

This commit is contained in:
Andrzej Stepien 2024-03-14 12:57:06 +01:00
parent ab1682da18
commit aa6d9b284f
1 changed files with 22 additions and 0 deletions

22
lua/setup/lsp.lua Normal file
View File

@ -0,0 +1,22 @@
local lspconfig = require("lspconfig")
require("mason-lspconfig").setup_handlers({
-- The first entry (without a key) will be the default handler
-- and will be called for each installed server that doesn't have
-- a dedicated handler.
function(server_name)
require("lspconfig")[server_name].setup({
on_attach = on_attach,
capabilities = capabilities,
--handlers = handlers,
})
end,
["eslint"] = function()
lspconfig.eslint.setup({
capabilities = capabilities,
--handlers = handlers,
on_attach = require("config.lsp.servers.eslint").on_attach,
settings = require("config.lsp.servers.eslint").settings,
})
end,
})