From 307aa67a9c41eea2d49526da4ee9670f2931a2a0 Mon Sep 17 00:00:00 2001 From: Blallo Date: Sun, 10 Mar 2024 22:34:02 +0100 Subject: [PATCH] Add elixirls lspconfig --- lua/config/lspconfig.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lua/config/lspconfig.lua b/lua/config/lspconfig.lua index 808f6c7..0d10f18 100644 --- a/lua/config/lspconfig.lua +++ b/lua/config/lspconfig.lua @@ -20,6 +20,19 @@ end 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 local on_attach = function(client, bufrn) @@ -62,6 +75,8 @@ local on_attach = function(client, bufrn) buf_set_keymap('n', 'f', 'lua vim.lsp.buf.format()', opts, "LSP", "formatting", "Format") end + + -- Launch language servers local servers = { 'harepls',