diff --git a/README.md b/README.md index 0eea596..68cde7c 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ end | cpp | clangd | | cmake | cmake-language-server | | css | css-language-features (pulled directly from the latest VSCode release) | +| elixir | Elixir Language Server (elixir-ls) | | dockerfile | docker-langserver | | go | gopls | | graphql | GraphQL language service | diff --git a/lua/lspinstall/servers.lua b/lua/lspinstall/servers.lua index 5bcab27..c540155 100644 --- a/lua/lspinstall/servers.lua +++ b/lua/lspinstall/servers.lua @@ -8,6 +8,7 @@ local servers = { ["diagnosticls"] = require'lspinstall/servers/diagnosticls', ["dockerfile"] = require'lspinstall/servers/dockerfile', ["efm"] = require'lspinstall/servers/efm', + ["elixir"] = require'lspinstall/servers/elixir', ["go"] = require'lspinstall/servers/go', ["graphql"] = require'lspinstall/servers/graphql', ["html"] = require'lspinstall/servers/html', diff --git a/lua/lspinstall/servers/elixir.lua b/lua/lspinstall/servers/elixir.lua new file mode 100644 index 0000000..8ecf105 --- /dev/null +++ b/lua/lspinstall/servers/elixir.lua @@ -0,0 +1,13 @@ +local config = require'lspconfig'.elixirls.document_config +require'lspconfig/configs'.elixirls = nil -- important, immediately unset the loaded config again +config.default_config.cmd = { "elixir-ls/language_server.sh" } + +return vim.tbl_extend('error', config, { + install_script = [[ + rm -rf elixir-ls + curl -fLO https://github.com/elixir-lsp/elixir-ls/releases/latest/download/elixir-ls.zip + unzip elixir-ls.zip -d elixir-ls + chmod +x elixir-ls/language_server.sh + rm -f elixir-ls.zip + ]], +})