nvim: Enable LSP for Elixir

This commit is contained in:
Sanchayan Maity 2024-09-29 15:38:51 +05:30
parent 9cddec5e81
commit 18106532fc
Signed by: sanchayanmaity
GPG key ID: 6F6A0609C12038F3
2 changed files with 18 additions and 0 deletions

View file

@ -0,0 +1,4 @@
local lsp_utils = require('lsp-utils')
local elixir_config = lsp_utils.elixir_config()
vim.lsp.start(elixir_config)

View file

@ -163,6 +163,20 @@ function M.deno_config()
} }
end end
function M.elixir_config()
local root_files = { 'mix.exs' }
local root_directory = get_root_directory(root_files)
return {
name = "elixirls",
cmd = { "elixir-ls" },
capabilities = default_capabilities,
root_dir = root_directory,
filetypes = { 'elixir', 'eelixir', 'heex', 'surface' },
single_file_support = true,
}
end
function M.gopls_config() function M.gopls_config()
local root_files = { 'go.mod', 'go.work', '.git' } local root_files = { 'go.mod', 'go.work', '.git' }
local root_directory = get_root_directory(root_files) local root_directory = get_root_directory(root_files)