chore: set elixir lsp cmd for version 1.12

This commit is contained in:
Joao P Dubas 2023-11-16 17:12:19 +00:00
parent 23c280dc2f
commit 1d0f23cf90

View File

@ -1,5 +1,5 @@
diff --git a/init.lua b/init.lua
index 3a98da0..e8e41b4 100644
index 3a98da0..e8c5b7d 100644
--- a/init.lua
+++ b/init.lua
@@ -229,7 +229,7 @@ require('lazy').setup({
@ -111,7 +111,7 @@ index 3a98da0..e8e41b4 100644
}
-- Setup neovim lua configuration
@@ -542,12 +578,20 @@ mason_lspconfig.setup {
@@ -542,12 +578,23 @@ mason_lspconfig.setup {
mason_lspconfig.setup_handlers {
function(server_name)
@ -124,9 +124,12 @@ index 3a98da0..e8e41b4 100644
}
+ if server_name == 'elixirls' then
+ local version = vim.fn.system('rtx current elixir') or ''
+ local match_version = string.match(version, '^1.11')
+ if match_version ~= nil then
+ opts = vim.tbl_extend('keep', opts, { cmd = { vim.fn.expand('$LOCAL_SRC_HOME') .. '/elixir-ls/release/language_server.sh' } })
+ local match_version_111 = string.match(version, '^1.11')
+ local match_version_112 = string.match(version, '^1.12')
+ if match_version_111 ~= nil then
+ opts = vim.tbl_extend('keep', opts, { cmd = { vim.fn.expand('$LOCAL_SRC_HOME') .. '/elixir-ls/v0.12.0/release/language_server.sh' } })
+ elseif match_version_112 ~= nil then
+ opts = vim.tbl_extend('keep', opts, { cmd = { vim.fn.expand('$LOCAL_SRC_HOME') .. '/elixir-ls/v0.14.6/release/language_server.sh' } })
+ end
+ end
+ require('lspconfig')[server_name].setup(opts)