Add elixirls lspconfig

This commit is contained in:
sfigato 2024-03-10 22:34:02 +01:00
parent 43baab0aaf
commit 307aa67a9c
Signed by: blallo
GPG Key ID: C530464EEDCF489A

View File

@ -20,6 +20,19 @@ end
require 'lspconfig'.rnix.setup {} require 'lspconfig'.rnix.setup {}
-- elixirls
if not configs.elixirls then
configs.elixirls = {
default_config = {
cmd = { '/usr/bin/elixir-ls' },
filetypes = { 'elixir' },
root_dir = function(fname)
return nvim_lsp.util.root_pattern("mix.exs", ".git")(fname) or vim.loop.os_homedir()
end,
}
}
end
-- keybindings -- keybindings
local on_attach = function(client, bufrn) local on_attach = function(client, bufrn)
@ -62,6 +75,8 @@ local on_attach = function(client, bufrn)
buf_set_keymap('n', '<space>f', '<cmd>lua vim.lsp.buf.format()<CR>', opts, "LSP", "formatting", "Format") buf_set_keymap('n', '<space>f', '<cmd>lua vim.lsp.buf.format()<CR>', opts, "LSP", "formatting", "Format")
end end
-- Launch language servers -- Launch language servers
local servers = { local servers = {
'harepls', 'harepls',